net.walend.disentangle.graph

Representations of various kinds of graphs. The top level, Graph, holds a Set of Nodes and a second collection of things that relate the nodes to each other -- the edges. Subtraits add features to these, and concrete implementations fill in with code tuned to particular uses.

Where possible, I use definitions from Wikipedia -- http://en.wikipedia.org/wiki/Graph_(mathematics)

I've left room in the hierarchy for a variety of kinds of graphs, but have only created the concrete classes I have real reasons to use. Please let me know if you need something specific.

Attributes

Since:

v0.1.0

Members list

Concise view

Type members

Classlikes

class AdjacencyDigraph[Node](outNodes: IndexedSet[Node], outSuccessors: IndexedSet[IndexedSet[(Node, Node)]], outPredecessors: IndexedSet[IndexedSet[(Node, Node)]]) extends Tuple2Digraph[Node] with IndexedGraph[Node]

Provides constant-time access for successor and predecessor edges of a node.

Provides constant-time access for successor and predecessor edges of a node.

The constructor is O(n + a ln(n))

Attributes

Since:

v0.2.1

Companion:
object
Graph
Supertypes
trait IndexedGraph[Node]
trait Tuple2Digraph[Node]
trait Digraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any

O(n ln(n) + e ln(n))

O(n ln(n) + e ln(n))

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class AdjacencyLabelDigraph[Node, Label](outNodes: IndexedSet[Node], outSuccessors: Vector[IndexedSet[(Node, Node, Label)]], outPredecessors: Vector[IndexedSet[(Node, Node, Label)]], val noEdgeExistsLabel: Label) extends IndexedLabelDigraph[Node, Label]

Provides constant-time access for successor and predecessor edges of a node.

Provides constant-time access for successor and predecessor edges of a node.

The constructor is O(n + a ln(n))

Attributes

Since:

v0.1.0

Companion:
object
Graph
Supertypes
trait IndexedLabelDigraph[Node, Label]
trait IndexedGraph[Node]
trait LabelDigraph[Node, Label]
trait Digraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any

O(n ln(n) + e ln(n))

O(n ln(n) + e ln(n))

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class AdjacencyLabelUndigraph[Node, Label](outNodes: IndexedSet[Node], outEdges: Vector[IndexedSet[(NodePair[Node], Label)]], val noEdgeExistsLabel: Label) extends IndexedLabelUndigraph[Node, Label]

Provides constant-time access for edges of a node.

Provides constant-time access for edges of a node.

The constructor is O(n + a ln(n))

Attributes

Since:

v0.2.1

Companion:
object
Graph
Supertypes
trait IndexedLabelUndigraph[Node, Label]
trait LabelUndigraph[Node, Label]
trait Undigraph[Node]
trait IndexedGraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any

O(n ln(n) + e ln(n))

O(n ln(n) + e ln(n))

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class AdjacencyUndigraph[Node](outNodes: IndexedSet[Node], adjacencyMatrix: Vector[IndexedSet[NodePair[Node]]]) extends IndexedUndigraph[Node]

Provides constant-time access for edges of a node.

Provides constant-time access for edges of a node.

The constructor is O(n + a ln(n))

Attributes

Since:

v0.2.1

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait IndexedUndigraph[Node]
trait Undigraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Digraph[Node] extends Graph[Node]

A graph with directed zero or one edges from any single node to any other single node.

A graph with directed zero or one edges from any single node to any other single node.

Attributes

Since:

v0.1.0

Graph
Supertypes
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
trait LabelDigraph[Node, Label]
trait IndexedLabelDigraph[Node, Label]
class AdjacencyLabelDigraph[Node, Label]
class MatrixLabelDigraph[Node, Label]
trait MutableLabelDigraph[Node, Label]
trait Tuple2Digraph[Node]
class AdjacencyDigraph[Node]

Create various types of graphs.

Create various types of graphs.

Attributes

Since:

v0.1.0

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Graph[Node]

Ancestor trait for a variety of Graphs.

Ancestor trait for a variety of Graphs.

A graph has Nodes that can be distinguished from each other. An InnerNodeType provides access to a nodes place in the graph.

I've pulled definitions from Wikipedia: http://en.wikipedia.org/wiki/Graph_(mathematics) where possible

Attributes

Since:

v0.1.0

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Digraph[Node]
trait LabelDigraph[Node, Label]
trait IndexedLabelDigraph[Node, Label]
class AdjacencyLabelDigraph[Node, Label]
class MatrixLabelDigraph[Node, Label]
trait MutableLabelDigraph[Node, Label]
trait Tuple2Digraph[Node]
class AdjacencyDigraph[Node]
trait IndexedGraph[Node]
trait IndexedLabelUndigraph[Node, Label]
class AdjacencyLabelUndigraph[Node, Label]
trait Undigraph[Node]
trait IndexedUndigraph[Node]
class AdjacencyUndigraph[Node]
trait LabelUndigraph[Node, Label]
trait IndexedGraph[Node] extends Graph[Node]

A graph that exposes the indices of stored nodes.

A graph that exposes the indices of stored nodes.

Implementers should also include some accessor for edges via indexes.

Attributes

Since:

v0.2.1

Graph
Supertypes
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyDigraph[Node]
trait IndexedLabelDigraph[Node, Label]
class AdjacencyLabelDigraph[Node, Label]
class MatrixLabelDigraph[Node, Label]
trait IndexedLabelUndigraph[Node, Label]
class AdjacencyLabelUndigraph[Node, Label]
trait IndexedLabelDigraph[Node, Label] extends LabelDigraph[Node, Label] with IndexedGraph[Node]

A digraph that exposes the indices of stored nodes.

A digraph that exposes the indices of stored nodes.

Attributes

Since:

v0.1.0

Graph
Supertypes
trait IndexedGraph[Node]
trait LabelDigraph[Node, Label]
trait Digraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyLabelDigraph[Node, Label]
class MatrixLabelDigraph[Node, Label]
trait IndexedLabelUndigraph[Node, Label] extends IndexedGraph[Node] with LabelUndigraph[Node, Label]

A digraph that exposes the indices of stored nodes.

A digraph that exposes the indices of stored nodes.

Attributes

Graph
Supertypes
trait LabelUndigraph[Node, Label]
trait Undigraph[Node]
trait IndexedGraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyLabelUndigraph[Node, Label]
final class IndexedSet[A](outerSeq: IndexedSeq[A]) extends Set[A] with SetOps[A, IndexedSet, IndexedSet[A]] with IterableFactoryDefaults[A, IndexedSet] with Serializable

Attributes

Since:

v0.1.0

Companion:
object
Graph
Supertypes
trait Serializable
trait Set[A]
trait SetOps[A, IndexedSet, IndexedSet[A]]
trait Set[A]
trait Equals
trait SetOps[A, IndexedSet, IndexedSet[A]]
trait A => Boolean
trait Iterable[A]
trait Iterable[A]
trait IterableFactoryDefaults[A, IndexedSet]
trait IterableOps[A, IndexedSet, IndexedSet[A]]
trait IterableOnceOps[A, IndexedSet, IndexedSet[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
object IndexedSet extends IterableFactory[IndexedSet]

Attributes

Companion:
class
Graph
Supertypes
trait IterableFactory[IndexedSet]
trait Serializable
class Object
trait Matchable
class Any
Self type
trait IndexedUndigraph[Node] extends Undigraph[Node]

A digraph that exposes the indices of stored nodes.

A digraph that exposes the indices of stored nodes.

Attributes

Graph
Supertypes
trait Undigraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyUndigraph[Node]
trait LabelDigraph[Node, Label] extends Digraph[Node]

A directed graph with labeled edges.

A directed graph with labeled edges.

Attributes

Since:

v0.1.0

Graph
Supertypes
trait Digraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
trait IndexedLabelDigraph[Node, Label]
class AdjacencyLabelDigraph[Node, Label]
class MatrixLabelDigraph[Node, Label]
trait MutableLabelDigraph[Node, Label]
trait LabelUndigraph[Node, Label] extends Undigraph[Node]

A directed graph with labeled edges.

A directed graph with labeled edges.

Attributes

Since:

v0.2.1

Graph
Supertypes
trait Undigraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
trait IndexedLabelUndigraph[Node, Label]
class AdjacencyLabelUndigraph[Node, Label]
case class NodePair[+A](_1: A, _2: A)

A pair of interchangable nodes, often used in Undigraph. Order of the nodes doesn't matter.

A pair of interchangable nodes, often used in Undigraph. Order of the nodes doesn't matter.

Attributes

Since:

v0.2.1

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
trait Tuple2Digraph[Node] extends Digraph[Node]

A directed graph with edges expressed as Tuple2s so that you can create edges with "a->b" in your code.

A directed graph with edges expressed as Tuple2s so that you can create edges with "a->b" in your code.

Attributes

Since:

v0.2.1

Graph
Supertypes
trait Digraph[Node]
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyDigraph[Node]
trait Undigraph[Node] extends Graph[Node]

A graph with undirected zero or one edges between any pair of nodes.

A graph with undirected zero or one edges between any pair of nodes.

Attributes

Since:

v0.2.1

Graph
Supertypes
trait Graph[Node]
class Object
trait Matchable
class Any
Known subtypes
trait IndexedUndigraph[Node]
class AdjacencyUndigraph[Node]
trait LabelUndigraph[Node, Label]
trait IndexedLabelUndigraph[Node, Label]
class AdjacencyLabelUndigraph[Node, Label]