Represents a graph structure defined by a sequence of edges. Each edge connects two vertices of type V and contains an attribute of type E. The EdgeList class allows for operations on the edges of the graph, such as transforming them into a sequence of triplets.
CONSIDER eliminate this type.
The graph is also associated with a type parameter Z, which can be used to define additional properties or characteristics of the graph or edges, such as edge types.
Type parameters
E
the type of the attributes associated with the edges.
V
the type of the vertices in the graph.
Z
a type parameter to describe additional properties, such as the nature of the edges.
Value parameters
edges
a sequence of edges that define the connections in the graph. Each edge connects a source vertex (white) and a target vertex (black), and may carry an associated attribute (attribute) and type (edgeType).
Generates a sequence of triplets, where each triplet represents an edge in the graph. Each triplet contains the source vertex, the target vertex, the attribute associated with the edge, and the type of the edge cast to type Z.
Generates a sequence of triplets, where each triplet represents an edge in the graph. Each triplet contains the source vertex, the target vertex, the attribute associated with the edge, and the type of the edge cast to type Z.
Attributes
Returns
a sequence of Triplet[V, E, Z], where each triplet describes the white vertex, the black vertex, the edge attribute (attribute), and the edge type (edgeType) of an edge in the graph.
Retrieves a sequence of pairs of vertices representing the connections in the graph. Each pair corresponds to an edge in the graph, where the first element is the starting vertex and the second element is the ending vertex of the edge.
Retrieves a sequence of pairs of vertices representing the connections in the graph. Each pair corresponds to an edge in the graph, where the first element is the starting vertex and the second element is the ending vertex of the edge.
Attributes
Returns
a sequence of vertex pairs (V, V) representing the connections in the graph. Each pair corresponds to the white and black vertices of an edge.
Serializes the sequence of triplets into a string representation. Each triplet is converted to a comma-separated string of its elements, and the entire sequence is joined using newline characters.
Serializes the sequence of triplets into a string representation. Each triplet is converted to a comma-separated string of its elements, and the entire sequence is joined using newline characters.
Attributes
Returns
a string representation of the triplets, where each triplet is serialized as "source, target, attribute" and each serialized triplet is separated by a newline.