case class UnDiGraph[T](vertices: Set[Node[T]], edges: Set[UnDiEdge[Node[T]]]) extends UnweightedGraph[T, UnDiEdge[Node[T]]] with Product with Serializable
Represents an unweighted undirected graph.
- T
The type of nodes in the graph.
- vertices
The set of vertices of the graph.
- edges
The set of edges of the graph.
- Alphabetic
- By Inheritance
- UnDiGraph
- Serializable
- Product
- Equals
- UnweightedGraph
- Graph
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +[X](_edges: Set[UnDiEdge[Node[T]]])(implicit arg0: ClassTag[X]): UnDiGraph[T]
Add a set of edges to the graph.
Add a set of edges to the graph.
This will also add vertices if any of the edges contains vertices not yet present in the graph.
- X
ClassTag parameter to ensure generic type is not erased.
- _edges
The set of edges to be added.
- returns
The graph with the added edges (and vertices).
- def +(edge: UnDiEdge[Node[T]]): UnDiGraph[T]
Add an edge to the graph.
- def +(_vertices: Set[Node[T]]): UnDiGraph[T]
Add a set of vertices to the graph.
- def +(vertex: Node[T]): UnDiGraph[T]
Add a vertex to the graph.
- def -[X](_edges: Set[UnDiEdge[Node[T]]])(implicit arg0: ClassTag[X]): UnDiGraph[T]
Remove a set of edges from the graph.
- def -(edge: UnDiEdge[Node[T]]): UnDiGraph[T]
Remove an edge from the graph.
- def -(_vertices: Set[Node[T]]): UnDiGraph[T]
Remove a set of vertices from the graph.
Remove a set of vertices from the graph.
Any edges connected to any of the vertices will also be removed. Vertices that are not part of the graph are ignored.
- _vertices
The vertices to be removed.
- returns
The graph minus the vertices and mines edges that were connected.
- def -(vertex: Node[T]): UnDiGraph[T]
Remove a vertex from the graph.
Remove a vertex from the graph.
Any edges connected to this vertex will also be removed. If the vertex is not part of the graph, this function returns the original graph.
- vertex
The vertex to be removed.
- returns
The graph minus the vertex and mines edges that were connected.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- lazy val adjacencyList: Map[Node[T], Set[Node[T]]]
The adjacency list for this graph, represented as a mapping from nodes to a set of neighboring nodes.
The adjacency list for this graph, represented as a mapping from nodes to a set of neighboring nodes. This is lazily (only when called) evaluated.
- Definition Classes
- UnweightedGraph
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def containsCycle: Boolean
Recursively checks if the graph contains a cycle.
Recursively checks if the graph contains a cycle.
- returns
if the graph contains a cycle,true
otherwise.false
- Definition Classes
- UnweightedGraph → Graph
- val edges: Set[UnDiEdge[Node[T]]]
- Definition Classes
- UnDiGraph → UnweightedGraph → Graph
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def isEmpty: Boolean
Tests if the graph contains any vertices.
Tests if the graph contains any vertices.
- returns
if the graph contains no vertices,true
otherwise.false
- Definition Classes
- Graph
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def merge[G <: Graph[T, UnDiEdge[Node[T]]]](that: G): UnDiGraph[T]
Merge two graphs of the same type.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noEdges: Boolean
Tests if the graph contains any edges.
Tests if the graph contains any edges.
- returns
if the graph no edges,true
otherwise.false
- Definition Classes
- Graph
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def nthAdjacencyList(n: Int): Map[Node[T], Set[Node[T]]]
Recursively computes the nth adjacency list.
Recursively computes the nth adjacency list.
- n
The required level.
- returns
The nth adjacency list.
- Definition Classes
- UnweightedGraph
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productIterator: Iterator[Any]
- Definition Classes
- Product
- def size: Int
Returns the number of vertices in the graph.
Returns the number of vertices in the graph.
- returns
The number of vertices in the graph.
- Definition Classes
- Graph
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val vertices: Set[Node[T]]
- Definition Classes
- UnDiGraph → UnweightedGraph → Graph
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])