import [Link].
Edge;
import [Link];
import [Link];
import [Link];
public class GraphUtils {
// Convert vertex into String
public static <V, E> String toString(Vertex<V> vertex){
return [Link]().toString();
}
// Convert edge into String
public static <V, E> String toString(Edge<E> edge){
return [Link]().toString();
}
// Convert vertex of edge from graph into specifc String representation
public static <V, E> String toString(Vertex<V> vertex, Edge<E> ofEdge,
Graph<V,E> fromGraph){
String representation = [Link]() + "("
+ [Link](ofEdge)[0].getElement() + "-"
+ [Link](ofEdge)[1].getElement() + ","
+ [Link]()
+ "),";
return [Link]("),",")");
}
// Convert all vertexes from edges within graph
// into specific single String representation
public static <V, E> String toStringAll(Vertex<V> vertex,
PositionalList<Edge<E>> ofEdgePath,
Graph<V,E> fromGraph){
String representation = [Link]() + "[";
for (Edge<E> e: ofEdgePath) {
representation += [Link](e)[0].getElement()
+ "-" + [Link](e)[1].getElement()
+ "(" + [Link]() + ")" + ",";
}
representation += "]";
return [Link](",]", "]");
}
}