UndirectedGraph

com.phasmidsoftware.gryphon.adjunct.UndirectedGraph
See theUndirectedGraph companion class

Factory object for creating instances of DirectedGraph. This object provides utility methods to construct a directed graph from an edge list representation.

Attributes

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

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def triplesToTryGraph[V, E](f: V => Vertex[V])(triples: Seq[Triplet[V, E, EdgeType]]): Try[Graph[V]]

Converts a sequence of triplets representing graph edges into a Try of Graph[V].

Converts a sequence of triplets representing graph edges into a Try of Graph[V].

Each triplet in the input sequence consists of two vertices (source and target) and an attribute associated with the edge connecting the vertices. This method attempts to construct a directed graph from the provided triplets, returning a Success with the graph instance if the operation is successful, or a Failure if the construction process encounters an error.

Type parameters

E

the type of the edges in the graph.

V

the type of the vertices in the graph.

Value parameters

triples

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 Try[Graph[V]], where: - Success(Graph[V]) contains the constructed graph if the operation is successful. - Failure contains a GraphException if the graph construction fails.