Represents a collection of directed connections between vertices, where each connection is associated with an additional attribute of type Z. The connections are stored as a sequence of tuples (V, V, Z), where the first element is the source vertex, the second is the target vertex, and the third is the associated attribute.
Type parameters
V
the type of the vertices in the connections.
Z
the type of the additional attribute associated with each connection.
Value parameters
pairs
a sequence of tuples representing the connections. Each tuple consists of a source vertex, a target vertex, and an additional attribute of type Z.
Attributes
Constructor
Creates an instance of ProtoConnexions initialized with a sequence of (V, V, Z) tuples.
Converts the current collection of directed connections represented as pairs of vertices into a sequence of triplets. Each triplet consists of the source vertex, the target vertex, a unit value, and an additional attribute of type Z.
Converts the current collection of directed connections represented as pairs of vertices into a sequence of triplets. Each triplet consists of the source vertex, the target vertex, a unit value, and an additional attribute of type Z.
Attributes
Returns
a sequence of triplets where each triplet is of the form (V, V, Unit, Z). The first element represents the source vertex, the second represents the target vertex, the third is a unit value, and the fourth corresponds to the additional attribute.
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.