make context great again

This commit is contained in:
2019-11-14 22:28:58 +03:00
parent 3560be99a1
commit 6a37870bd2
12 changed files with 160 additions and 84 deletions

View File

@ -16,7 +16,7 @@ func GetTriangles(coords []types.Coords, w, h int) []types.Edge {
return output
}
func GetMst(coords []types.Coords, w, h int) []types.Edge {
func GetMst(coords []types.Coords, w, h, negativeWeight int) []types.Edge {
d := &Delaunay{}
@ -48,7 +48,7 @@ func GetMst(coords []types.Coords, w, h int) []types.Edge {
kruskals.SimpleWeightedEdge{
nodeMap[e.Nodes[0].Id],
nodeMap[e.Nodes[1].Id],
int(e.Nodes[0].Coords.DistanceTo(e.Nodes[1].Coords))},
negativeWeight - int(e.Nodes[0].Coords.DistanceTo(e.Nodes[1].Coords))},
)
}