Graph

org.encalmo.data.Graph
See theGraph companion trait
object Graph

Graph operations.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Graph.type

Members list

Type members

Classlikes

trait DfsVisitor[N]

Attributes

Supertypes
class Object
trait Matchable
class Any
final class GenericGraphImpl[N](val nodes: Traversable[N], val adjacent: N => Traversable[N]) extends GenericGraph[N]

Attributes

Supertypes
trait GenericGraph[N]
trait Graph[N]
class Object
trait Matchable
class Any

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
final class ReversedMutableMapGraph[N](_reverse: Graph[N]) extends MutableMapGraph[N]

Attributes

Supertypes
class MutableMapGraph[N]
trait Mutable[N]
trait Shrinkable[(N, N)]
trait Growable[(N, N)]
trait Clearable
trait GenericGraph[N]
trait Graph[N]
class Object
trait Matchable
class Any
Show all
final class WeightedGraphImpl[N, V](val nodes: Traversable[N], val adjacent: N => Traversable[N], val weight: (N, N) => V)(implicit evidence$1: Numeric[V]) extends GenericGraph[N], Weighted[N, V]

Attributes

Supertypes
trait Weighted[N, V]
trait GenericGraph[N]
trait Graph[N]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def apply[N](): MutableMapGraph[N]
inline def apply[N](map: Map[N, Traversable[N]]): MapGraph[N]
inline def apply[N](mappings: (N, Traversable[N])*): MapGraph[N]
inline def apply[N](nodes: Iterable[N], adjacent: N => Traversable[N]): Graph[N]
inline def apply[N](edges: Traversable[(N, N)]): MutableMapGraph[N]
inline def apply[N](edges: Iterator[(N, N)]): MutableMapGraph[N]
def apply[N, V : Numeric](mappings: (N, Iterable[(N, V)])*): Graph[N] & Weighted[N, V]
inline def hardCopy[N](graph: Graph[N]): MutableMapGraph[N]
inline def hardCopyReversed[N](graph: Graph[N]): MutableMapGraph[N]
def readFromEdgeListFile(path: Source, reversed: Boolean): Graph[Int]

Extensions

Extensions

extension [N](graph: Graph[N])
def bfs(visitor: N => Unit): Unit

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

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

Depth-first search of the whole graph

Depth-first search of the whole graph

Attributes

def dfs(visitor: DfsVisitor[N], nodes: Traversable[N]): Unit

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

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

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]
def findCycles(node: N, marks: Map[N, Char]): Vector[N]
def merge(graph2: Graph[N]): Graph[N]

Merges two graphs without duplicating existing nodes

Merges two graphs without duplicating existing nodes

Attributes

def mergeNodes(mergedNode: N, removedNode: N): MutableMapGraph[N]

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]

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]

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]

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

def successorsOf(node: N): Graph[N]

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]

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

extension [N, V](graph: Graph[N] & Weighted[N, V])(implicit evidence$1: Numeric[V])
inline def findShortestPath: (V, List[(N, N)])

Dijkstra algorithm finds shortest path in directed graph

Dijkstra algorithm finds shortest path in directed graph

Attributes

def findShortestPath: (V, List[(N, N)])

Dijkstra algorithm finds the shortest path in a directed graph

Dijkstra algorithm finds the shortest path in a directed graph

Attributes

inline def findShortestPaths: Map[N, V]

Dijkstra algorithm finds all shortest paths starting at given node in directed graph

Dijkstra algorithm finds all shortest paths starting at given node in directed graph

Attributes

def findShortestPaths: Map[N, V]

Dijkstra algorithm finds all shortest paths starting at given node in directed graph

Dijkstra algorithm finds all shortest paths starting at given node in directed graph

Attributes