org.metasyntactic.math
Interface Graph.Path

Enclosing interface:
Graph

public static interface Graph.Path

A path of length k from a vertex u to a vertex u' in a Graph G = (V, E) is a sequence ⟨v0, v1, 2, …, vk⟩ of vertices such that u = v0, u' = vk, and (vi-1, vi) ∈ E for i = 1, 2, …, k.


Method Summary
 boolean containsEdge(Graph.Edge edge)
          The path contains the edges (v0, v1), (v1, v2), …, (vk-1, vk).
 boolean containsVertex(java.lang.Object vertex)
          The path contains the vertices v0, v1, 2, …, vk
 int getLength()
          The length of the path is the number of edges in the path.
 boolean isSimple()
          A path is simple if all vertices in the path are distinct.
 

Method Detail

getLength

public int getLength()
The length of the path is the number of edges in the path.

Returns:
the number of edges in the path

containsVertex

public boolean containsVertex(java.lang.Object vertex)
The path contains the vertices v0, v1, 2, …, vk

Returns:
true if this path contains this vertex

containsEdge

public boolean containsEdge(Graph.Edge edge)
The path contains the edges (v0, v1), (v1, v2), …, (vk-1, vk).


isSimple

public boolean isSimple()
A path is simple if all vertices in the path are distinct.

Returns:
true if the path is simple