Class Graph
java.lang.Object
com.thomas.graphs.Graph
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an unweighted edge to the graphvoidAdds an edge to the graphvoidaddUndirectedEdge(Vertex v1, Vertex v2) Creates an unweighted, undirected edge in the graph between tow verticesvoidaddUndirectedEdge(Vertex v1, Vertex v2, int weight) Creates an undirected edge in the graph between two verticesvoidAdds a new vertex to the graphThe Breath-first Search algorithmGets the neightbours of a vertexGets the vertices in the graphtoString()
-
Field Details
-
INFINITY
public static final int INFINITYInifinty- See Also:
-
adjList
-
-
Constructor Details
-
Graph
public Graph()Creates a new Graph
-
-
Method Details
-
addVertex
-
addEdge
-
addEdge
-
addUndirectedEdge
-
addUndirectedEdge
-
getNeightbours
-
getVertices
-
toString
-
bfs
-