package org.psjava.ds.graph;

public class TestGraphFactory {

	public static MutableDirectedWeightedGraph<Integer, Integer> create(int[][] edata) {
		MutableDirectedWeightedGraph<Integer, Integer> g = new MutableDirectedWeightedGraph<Integer, Integer>();
		for (int[] e : edata) {
			g.insertVertex(e[0]);
			g.insertVertex(e[1]);
			g.addEdge(e[0], e[1], e[2]);
		}
		return g;
	}

}

@@ -60,16 +60,56 @@
 ry %7B%0D%0A%0D%0A
+%09// TODO rename createDirectedWeighted%0D%0A
 %09public 
@@ -181,24 +181,25 @@
 %5D%5B%5D edata) %7B
+ 
 %0D%0A%09%09MutableD
@@ -371,24 +371,24 @@
 tex(e%5B1%5D);%0D%0A
-
 %09%09%09g.addEdge
@@ -432,11 +432,298 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09public static Graph%3CString, DirectedEdge%3CString%3E%3E createDirected(String%5B%5D%5B%5D edata) %7B%0D%0A%09%09MutableDirectedGraph%3CString%3E g = MutableDirectedGraph.create();%0D%0A%09%09for (String%5B%5D e : edata) %7B%0D%0A%09%09%09g.insertVertex(e%5B0%5D);%0D%0A%09%09%09g.insertVertex(e%5B1%5D);%0D%0A%09%09%09g.addEdge(e%5B0%5D, e%5B1%5D);%0D%0A%09%09%7D%0D%0A%09%09return g;%0D%0A%09%7D%0D%0A%0D%0A
 %7D%0D%0A

add a test util method