diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java new file mode 100644 index 00000000..51565201 --- /dev/null +++ b/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java @@ -0,0 +1,22 @@ +package com.pahimar.ee3.emc.graph; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; + + +public class WeightedDirectedGraph implements Iterable { + + private final Map> graph = new HashMap>(); + private List orderedNodes = new ArrayList(); + + @Override + public Iterator iterator() { + + return orderedNodes.iterator(); + } + +} diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java new file mode 100644 index 00000000..a2d41d9e --- /dev/null +++ b/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java @@ -0,0 +1,35 @@ +package com.pahimar.ee3.emc.graph; + + + +public class WeightedEdge { + + private int weight; + private T target; + + public WeightedEdge(int weight, T target) { + + this.weight = weight; + this.target = target; + } + + public int getWeight() { + + return weight; + } + + public T getTarget() { + + return target; + } + + public void setWeight(int weight) { + + this.weight = weight; + } + + public void setTarget(T target) { + + this.target = target; + } +}