This commit is contained in:
2022-02-22 22:10:09 -06:00
parent f8167b0774
commit a7afeb6119
3 changed files with 15 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ import org.jgrapht.graph.SimpleWeightedGraph;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
public abstract class GraphModificationFunctions {
@@ -18,9 +19,11 @@ public abstract class GraphModificationFunctions {
Integer weight = (int) graph.getEdgeWeight(e);
Integer[] edge = {source, target, weight};
removedEdges.add(edge);
graph.removeEdge(e);
}
}
for (Integer[] edge : removedEdges) {
graph.removeEdge(edge[0], edge[1]);
}
return removedEdges;
}
@@ -41,9 +44,11 @@ public abstract class GraphModificationFunctions {
Integer weight = (int) graph.getEdgeWeight(e);
Integer[] edge = {source, target, weight};
removedEdges.add(edge);
graph.removeEdge(e);
}
}
for (Integer[] edge : removedEdges) {
graph.removeEdge(edge[0], edge[1]);
}
return removedEdges;
}
@@ -66,9 +71,11 @@ public abstract class GraphModificationFunctions {
Integer intWeight = (int) graph.getEdgeWeight(e);
Integer[] edge = {source, target, intWeight};
removedEdges.add(edge);
graph.removeEdge(e);
}
}
for (Integer[] edge : removedEdges) {
graph.removeEdge(edge[0], edge[1]);
}
return removedEdges;
}