SerializableGraph

com.phasmidsoftware.gryphon.core.SerializableGraph
See theSerializableGraph companion trait

Object providing factory methods for creating instances of the SerializableGraph trait.

The SerializableGraph represents a graph structure that can be serialized and traversed. This companion object includes methods to construct graphs from sequences of edges or vertex pairs.

Attributes

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

Members list

Value members

Concrete methods

def createFromPairs[V, Z](pairs: Seq[(V, V, Z)]): SerializableGraph[V, Unit, Z]

Creates a SerializableGraph instance from a sequence of vertex pairs.

Creates a SerializableGraph instance from a sequence of vertex pairs.

Each pair in the input sequence represents an edge in the graph, defined by two vertices. The resulting graph uses the pairs to establish connections between vertices, with no additional attributes associated with the edges.

Type parameters

V

the type associated with the vertices in the graph.

Z

the generic type for edge type.

Value parameters

pairs

a sequence of tuples (V, V) where each tuple represents a vertex pair in the graph. The first element of the tuple is the source vertex, and the second element is the target vertex.

Attributes

Returns

a ProtoConnexions[V] representing the graph constructed from the specified vertex pairs.

def createFromTriplets[V, E, Z](triplets: Seq[Triplet[V, E, Z]]): SerializableGraph[V, E, Z]

Creates a SerializableGraph instance from a sequence of triplets.

Creates a SerializableGraph instance from a sequence of triplets.

Each triplet in the input sequence represents an edge in the graph, consisting of two vertices (source and target) and an edge attribute.

Type parameters

E

the type associated with the edges in the graph.

V

the type associated with the vertices in the graph.

Z

the generic type for edge type.

Value parameters

triplets

a sequence of triplets Triplet[V, E], where: - the first element is the source vertex of type V. - the second element is the target vertex of type V. - the third element is the edge attribute of type E.

Attributes

Returns

a SerializableGraph[V, E] representing the graph described by the provided triplets.