Graph

org.encalmo.data.Graph
See theGraph companion object
trait Graph[N]

Base asbtraction of the graph-like data structures.

Type parameters

N

The type of the nodes in the graph.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait GenericGraph[N]
class GenericGraphImpl[N]
class WeightedGraphImpl[N, V]
class MapGraph[N]
class IntMapGraph
class MutableMapGraph[N]
Show all

Members list

Value members

Abstract methods

def adjacent: N => Traversable[N]

The adjacent nodes for each node.

The adjacent nodes for each node.

Attributes

def contains(node: N): Boolean

Whether the graph contains the node.

Whether the graph contains the node.

Attributes

def edges: Traversable[(N, N)]

The edges in the graph.

The edges in the graph.

Attributes

The number of edges in the graph.

The number of edges in the graph.

Attributes

def hasAdjacent(node: N): Boolean

Whether the node has any adjacent nodes.

Whether the node has any adjacent nodes.

Attributes

def nodes: Traversable[N]

The nodes in the graph.

The nodes in the graph.

Attributes

The number of nodes in the graph.

The number of nodes in the graph.

Attributes

def reverse: Graph[N]

The reverse of the graph.

The reverse of the graph.

Attributes

Concrete methods

def bfs(visitor: N => Unit): Unit
Extension method from Graph

Breath-first search of the whole graph

Breath-first search of the whole graph

Attributes

def bfs(node: N, visitor: N => Unit, explored: HashSet[N] = ...): Unit
Extension method from Graph

Breath-first search of the graph starting at given node

Breath-first search of the graph starting at given node

Attributes

inline def dfs(visitor: DfsVisitor[N]): Unit
Extension method from Graph

Depth-first search of the whole graph

Depth-first search of the whole graph

Attributes

def dfs(visitor: DfsVisitor[N], nodes: Traversable[N]): Unit
Extension method from Graph

Depth-first search of the whole graph in the given node's order

Depth-first search of the whole graph in the given node's order

Attributes

def dfs(node: N, visitor: DfsVisitor[N], explored: HashSet[N] = ...): Unit
Extension method from Graph

Depth-first search (recursive) of the graph starting at given node

Depth-first search (recursive) of the graph starting at given node

Attributes

def dfsi(source: N, visitor: DfsVisitor[N], explored: HashSet[N] = ...): Unit
Extension method from Graph

Depth-first search (iterative) of the graph starting at given node

Depth-first search (iterative) of the graph starting at given node

Attributes

def findCycles: Vector[N]
Extension method from Graph

Find cycles in the graph.

Find cycles in the graph.

Attributes

def findCycles(node: N, marks: Map[N, Char] = ...): Vector[N]
Extension method from Graph

Find cycles in the graph starting at given node.

Find cycles in the graph starting at given node.

Attributes

Extension method from Graph

Check if the graph has cycles.

Check if the graph has cycles.

Attributes

Extension method from Graph
def merge(graph2: Graph[N]): Graph[N]
Extension method from Graph

Merges two graphs without duplicating existing nodes

Merges two graphs without duplicating existing nodes

Attributes

def mergeNodes(mergedNode: N, removedNode: N): MutableMapGraph[N]
Extension method from Graph

Merge two nodes in the mutable map graph.

Merge two nodes in the mutable map graph.

Attributes

Extension method from Graph

Returns a new graph containing only all the transitive predecessors and successors of the given node.

Returns a new graph containing only all the transitive predecessors and successors of the given node.

Attributes

def predecessorsAndSuccessorsOf(nodes: N*): Graph[N]
Extension method from Graph

Returns a new graph containing only all the transitive predecessors and successors of the given nodes.

Returns a new graph containing only all the transitive predecessors and successors of the given nodes.

Attributes

def predecessorsOf(node: N): Graph[N]
Extension method from Graph

Returns a new graph containing only all the transitive predecessors of the given node.

Returns a new graph containing only all the transitive predecessors of the given node.

Attributes

def predecessorsOf(nodes: N*): Graph[N]
Extension method from Graph

Returns a new graph containing only all the transitive predecessors of the given nodes.

Returns a new graph containing only all the transitive predecessors of the given nodes.

Attributes

Extension method from Graph

Count the number of random cuts in the graph.

Count the number of random cuts in the graph.

Attributes

Extension method from Graph
Extension method from Graph

Sort the graph topologically.

Sort the graph topologically.

Attributes

def successorsOf(node: N): Graph[N]
Extension method from Graph

Returns a new graph containing only all the transitive successors of the given node.

Returns a new graph containing only all the transitive successors of the given node.

Attributes

def successorsOf(nodes: N*): Graph[N]
Extension method from Graph

Returns a new graph containing only all the transitive successors of the given nodes.

Returns a new graph containing only all the transitive successors of the given nodes.

Attributes