package graph.examples; import graph.SimpleVertex; import graph.Edge; import graph.Graph; import graph.Vertex; import java.util.ArrayList; public class Undirected { public Undirected() { v1 = new SimpleVertex("1"); v2 = new SimpleVertex("2"); v3 = new SimpleVertex("3"); v4 = new SimpleVertex("4"); v5 = new SimpleVertex("5"); vertices = new ArrayList<Vertex>(); vertices.add(v1); vertices.add(v2); vertices.add(v3); vertices.add(v4); vertices.add(v5); edges = new ArrayList<Edge>(); edges.add(new Edge(v1, v2)); edges.add(new Edge(v1, v5)); edges.add(new Edge(v2, v5)); edges.add(new Edge(v2, v4)); edges.add(new Edge(v2, v3)); edges.add(new Edge(v3, v4)); edges.add(new Edge(v4, v5)); graph = new Graph(vertices, edges, false); } public Vertex getV1() { return v1; } public void setV1(Vertex v1) { this.v1 = v1; } public Vertex getV2() { return v2; } public void setV2(Vertex v2) { this.v2 = v2; } public Vertex getV3() { return v3; } public void setV3(Vertex v3) { this.v3 = v3; } public Vertex getV4() { return v4; } public void setV4(Vertex v4) { this.v4 = v4; } public Vertex getV5() { return v5; } public void setV5(Vertex v5) { this.v5 = v5; } public Graph getGraph() { return graph; } private Vertex v1, v2, v3, v4, v5; private ArrayList<Vertex> vertices; private ArrayList<Edge> edges; private Graph graph; }