diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java index ddba370b..d5123798 100644 --- a/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java +++ b/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java @@ -84,6 +84,24 @@ public class WeightedDirectedGraph implements Iterable { return Collections.unmodifiableSortedSet(graph.get(from)); } + + public void removeEdge(T from, T to) { + + removeEdge(from, to, 1); + } + + public void removeEdge(T from, T to, int weight) { + + if (!(graph.containsKey(from) && graph.containsKey(to))) { + throw new NoSuchElementException("Missing nodes from graph"); + } + +// TODO Finish this + } + + public void removeAllEdges(T from, T to) { +// TODO Finish this + } @Override public Iterator iterator() { diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java index 441a8663..9451c53d 100644 --- a/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java +++ b/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java @@ -2,16 +2,16 @@ package com.pahimar.ee3.emc.graph; public class WeightedEdge { - private int weight; + private float weight; private T target; - public WeightedEdge(int weight, T target) { + public WeightedEdge(float weight, T target) { this.weight = weight; this.target = target; } - public int getWeight() { + public float getWeight() { return weight; } @@ -21,7 +21,7 @@ public class WeightedEdge { return target; } - public void setWeight(int weight) { + public void setWeight(float weight) { this.weight = weight; }