Added max flow algorithm.

This commit is contained in:
Unick Soft
2018-04-14 22:39:52 +03:00
parent e14bf77af6
commit c1c0d55075
10 changed files with 633 additions and 101 deletions

View File

@@ -95,9 +95,9 @@ BaseEdgeDrawer.prototype.Draw = function(baseEdge, arcStyle)
var positions = this.GetArcPositions(baseEdge.vertex1.position, baseEdge.vertex2.position, baseEdge.vertex1.model.diameter);
this.DrawArc (positions[0], positions[1], arcStyle);
if (baseEdge.useWeight)
if (baseEdge.GetText().length > 0)
{
this.DrawWeight(positions[0], positions[1], baseEdge.weight, arcStyle, baseEdge.hasPair);
this.DrawWeight(positions[0], positions[1], baseEdge.GetText(), arcStyle, baseEdge.hasPair);
}
}
@@ -226,10 +226,10 @@ DirectArcDrawer.prototype.Draw = function(baseEdge, arcStyle)
this.context.lineWidth = 0;
this.DrawArrow(positions[0], positions[1], length, width);
if (baseEdge.useWeight)
if (baseEdge.GetText().length > 0)
{
baseDrawer.DrawWeight(positions[0], positions[1], baseEdge.weight, arcStyle, baseEdge.hasPair);
}
baseDrawer.DrawWeight(positions[0], positions[1], baseEdge.GetText(), arcStyle, baseEdge.hasPair);
}
}
DirectArcDrawer.prototype.DrawArrow = function(position1, position2, length, width)