com.phasmidsoftware.gryphon.core

This package object contains definitions and type aliases used across the core package. NOTE: maybe this is not strictly necessary in Scala 3 but it's helpful to have definitions in one place.

Attributes

Members list

Type members

Classlikes

abstract class AbstractBag[+X](xs: Seq[X]) extends Bag[X]

An abstract implementation of the Bag trait that uses a Seq to store elements. This class provides a collection-like structure where elements can be added, and iteration over the stored elements is supported.

An abstract implementation of the Bag trait that uses a Seq to store elements. This class provides a collection-like structure where elements can be added, and iteration over the stored elements is supported.

Type parameters

X

the type of elements contained within the AbstractBag[X]. The type is covariant to allow ListBag[A] to be used as ListBag[B] if A is a subtype of B.

Value parameters

xs

a sequence of elements of type X, representing the contents of this ListBag.

Attributes

Supertypes
trait Bag[X]
trait IterableOnce[X]
class Object
trait Matchable
class Any
Known subtypes
class ListBag[X]
abstract class AbstractGraph[V](vertexMap: VertexMap[V]) extends Graph[V]

An abstract base class for graph implementations backed by a VertexMap.

An abstract base class for graph implementations backed by a VertexMap.

Type parameters

V

the type of the vertex attributes (invariant).

Value parameters

vertexMap

the VertexMap holding the vertices of this graph.

Attributes

Supertypes
trait Graph[V]
trait Traversable[V]
class Object
trait Matchable
class Any
Known subtypes
class DirectedGraph[V, E]
trait DAG[V, E]
class UndirectedGraph[V, E]
abstract class AbstractUnordered[+T](elements: IterableOnce[T]) extends Unordered[T]

Abstract base class providing common implementations for unordered collections. Concrete subclasses (Unordered_Bag and Unordered_Set) differ in their underlying storage and duplicate-handling behaviour.

Abstract base class providing common implementations for unordered collections. Concrete subclasses (Unordered_Bag and Unordered_Set) differ in their underlying storage and duplicate-handling behaviour.

Type parameters

T

the type of elements contained in the collection (covariant).

Value parameters

elements

the underlying storage, accessed via IterableOnce.

Attributes

Supertypes
trait Unordered[T]
class Object
trait Matchable
class Any
Known subtypes
class Unordered_Bag[T]
class Unordered_Set[T]
abstract class AbstractVertex[V](val attribute: V, val adjacencies: Adjacencies[V]) extends Vertex[V]

Base class for all concrete vertex implementations.

Base class for all concrete vertex implementations.

Type parameters

V

the type of the vertex attribute.

Value parameters

adjacencies

the collection of adjacencies.

attribute

the data associated with this vertex.

Attributes

Supertypes
trait Vertex[V]
trait Attribute[V]
class Object
trait Matchable
class Any
Known subtypes
class RelaxableVertex[V, R]
class SimpleVertex[V]
trait Adjacency[V]

Hierarchical trait defining the behavior of an "adjacency." An adjacency is a relationship between two adjacent vertices in a graph structure.

Hierarchical trait defining the behavior of an "adjacency." An adjacency is a relationship between two adjacent vertices in a graph structure.

Adjacencies are the fundamental building blocks of a graph structure because from any given vertex, it is only possible to traverse to the vertices that are adjacent to it.

The discovered flag has been removed from Adjacency and its implementations. Visited-node tracking is now handled by the immutable VisitedSet[V] typeclass inside the Visitor V1.2.0 traversal engine.

Type parameters

V

the underlying vertex attribute type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AdjacencyEdge[V, E]
class AdjacencyVertex[V]
case class AdjacencyEdge[V, E](connexion: Connexion[V], flipped: Boolean = ...) extends Adjacency[V]

Represents an adjacency in the form of an edge within a graph structure. In the case of an undirected edge, flipped indicates which direction is used.

Represents an adjacency in the form of an edge within a graph structure. In the case of an undirected edge, flipped indicates which direction is used.

Type parameters

E

the type of the edge attributes.

V

the type of the vertex attributes.

Value parameters

connexion

the edge instance containing vertex connection and attribute information.

flipped

true if the nominal direction of the edge is reversed.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Adjacency[V]
class Object
trait Matchable
class Any
Show all
case class AdjacencyVertex[V](vertex: V) extends Adjacency[V]

Represents an adjacency defined purely by a vertex (no associated edge).

Represents an adjacency defined purely by a vertex (no associated edge).

Type parameters

V

the type of the vertex attribute.

Value parameters

vertex

the vertex associated with this adjacency.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Adjacency[V]
class Object
trait Matchable
class Any
Show all

Companion object for AdjacencyVertex.

Companion object for AdjacencyVertex.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Attribute[+A]

Hierarchical trait defining a (single) attribute of type A.

Hierarchical trait defining a (single) attribute of type A.

Used as a base trait by Vertex and Edge to expose their defining attribute.

Type parameters

A

an attribute

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Edge[V, E]
trait DirectedEdge[V, E]
class OrderedEdge[V]
class UndirectedEdge[V, E]
trait OrderableEdge[V, E]
trait OrderedAttribute[A]
trait Vertex[V]
class AbstractVertex[V]
class RelaxableVertex[V, R]
class SimpleVertex[V]
Show all
trait Attributed[T, A]

A type-class trait defining a mechanism to associate an attribute of type A with an entity of type T.

A type-class trait defining a mechanism to associate an attribute of type A with an entity of type T.

The Attributed trait provides an abstraction to retrieve an attribute from a given object. It is intended to be mixed into types that need to support mapping an item to its associated attribute.

Type parameters

A

the type of the attribute that can be retrieved from the entity.

T

the type of the entity with which the attribute is associated.

Attributes

Supertypes
class Object
trait Matchable
class Any
trait Bag[+X] extends IterableOnce[X]

A trait representing a collection of elements in an unordered bag-like structure, a multi-set in other words. This collection allows duplicates and provides operations for adding elements, checking membership, and querying its properties such as size and emptiness.

A trait representing a collection of elements in an unordered bag-like structure, a multi-set in other words. This collection allows duplicates and provides operations for adding elements, checking membership, and querying its properties such as size and emptiness.

Type parameters

X

the type of elements contained in the bag. As a covariant type parameter, X allows subtypes of the specified type to be used in the bag.

Attributes

Companion
object
Supertypes
trait IterableOnce[X]
class Object
trait Matchable
class Any
Known subtypes
class AbstractBag[X]
class ListBag[X]
object Bag

Provides factory methods for creating instances of Bag.

Provides factory methods for creating instances of Bag.

A Bag is an unordered collection that allows duplicate elements. This object serves as the companion object to the Bag type, offering utility functions to create empty or populated Bag instances.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Bag.type
trait Connected[V]

Trait to model the capability of answering connectivity queries over a set of objects.

Trait to model the capability of answering connectivity queries over a set of objects.

A type implementing Connected[V] can determine whether any two objects of type V belong to the same connected component.

Note the distinction from Connexion[V], which models a specific edge between exactly two vertices. Connected[V] is a higher-level oracle over the whole structure.

Typical implementations: ConnectivityLazy, WeightedUnionFind, ConnectedComponents.

Type parameters

V

the underlying object type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AbstractDisjointSet[V, W, This]
class ConnectivityASP[V]
class ConnectivityLazy[V]
trait Connectivity[V]
Show all
trait Connexion[V]

A trait representing a connection between two vertices in a graph structure. This trait is designed to generalize the concept of a connexion between exactly two vertices in a graph. The vertices are called white and black in order to avoid any suggestion of an order. NOTE: if you're curious why I use the archaic spelling "Connexion", see https://en.wikipedia.org/wiki/Connexion_(graph_theory)

A trait representing a connection between two vertices in a graph structure. This trait is designed to generalize the concept of a connexion between exactly two vertices in a graph. The vertices are called white and black in order to avoid any suggestion of an order. NOTE: if you're curious why I use the archaic spelling "Connexion", see https://en.wikipedia.org/wiki/Connexion_(graph_theory)

Type parameters

V

the type representing the vertices connected by this edge. It could be any user-defined type that models a vertex.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Edge[V, E]
trait DirectedEdge[V, E]
class OrderedEdge[V]
class UndirectedEdge[V, E]
trait OrderableEdge[V, E]
class VertexPair[V]
Show all
trait DAG[V, E] extends DirectedGraph[V, E]

Trait to model the behavior of directed acyclic graph.

Trait to model the behavior of directed acyclic graph.

Type parameters

E

the edge-attribute type.

V

the (key) vertex-attribute type.

Attributes

Supertypes
class DirectedGraph[V, E]
trait Serializable
trait Product
trait Equals
trait EdgeGraph[V, E]
trait EdgeTraversable[V, E]
class AbstractGraph[V]
trait Graph[V]
trait Traversable[V]
class Object
trait Matchable
class Any
Show all
object Directed extends EdgeType

The Directed object represents a directed edge type in a graph, where the edge has a specific direction (one-way). It extends the EdgeType trait and implements the oneWay method, which always returns true to indicate that the edge is directed.

The Directed object represents a directed edge type in a graph, where the edge has a specific direction (one-way). It extends the EdgeType trait and implements the oneWay method, which always returns true to indicate that the edge is directed.

Attributes

Supertypes
trait EdgeType
class Object
trait Matchable
class Any
Self type
Directed.type
trait Edge[V, E] extends Attribute[E], Connexion[V]

Defines an abstraction for an edge in a graph structure that connects two vertices. An Edge may be directed or undirected, and it carries an attribute of type E.

Defines an abstraction for an edge in a graph structure that connects two vertices. An Edge may be directed or undirected, and it carries an attribute of type E.

The connection is established between two vertices of type V, referred to as white and black. The type (directionality) of the edge, as well as whether it allows traversal in one or both directions, is given by the edgeType field.

Type parameters

E

the type of the attribute associated with the edge.

V

the type of the vertices connected by the edge.

Attributes

Supertypes
trait Connexion[V]
trait Attribute[E]
class Object
trait Matchable
class Any
Known subtypes
trait DirectedEdge[V, E]
class OrderedEdge[V]
class UndirectedEdge[V, E]
trait OrderableEdge[V, E]
trait EdgeGraph[V, E] extends Graph[V], EdgeTraversable[V, E]

A trait for graphs that carry both vertices and edges, supporting edge-based operations.

A trait for graphs that carry both vertices and edges, supporting edge-based operations.

Type parameters

E

the type of the edge attributes.

V

the type of the vertex attributes.

Attributes

Supertypes
trait EdgeTraversable[V, E]
trait Graph[V]
trait Traversable[V]
class Object
trait Matchable
class Any
Show all
Known subtypes
class DirectedGraph[V, E]
trait DAG[V, E]
class UndirectedGraph[V, E]
case class EdgeList[V, E, Z](edges: Seq[Edge[V, E]]) extends SerializableGraph[V, E, Z], Edges[V, E]

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.

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).

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Edges[V, E]
trait Pairs[V, EdgeType]
trait SerializableGraph[V, E, Z]
class Object
trait Matchable
class Any
Show all
trait EdgeTraversable[V, E] extends Traversable[V]

A trait representing a traversable structure that encompasses both vertices and edges.

A trait representing a traversable structure that encompasses both vertices and edges.

Type parameters

E

the type of the attribute associated with an edge.

V

the type of the vertices.

Attributes

Supertypes
trait Traversable[V]
class Object
trait Matchable
class Any
Known subtypes
trait EdgeGraph[V, E]
class DirectedGraph[V, E]
trait DAG[V, E]
class UndirectedGraph[V, E]
object EdgeType

The EdgeType object provides utilities and definitions for working with edge types in a graph, including traits and implicit parsers. Edge types include Directed, Undirected, and Undefined.

The EdgeType object provides utilities and definitions for working with edge types in a graph, including traits and implicit parsers. Edge types include Directed, Undirected, and Undefined.

It includes a companion object for parsing strings into EdgeType instances using the ParseableEdgeType trait. This allows for flexible and structured parsing of textual representations of edge types into their corresponding instances.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
EdgeType.type
trait EdgeType

A trait representing the type of an edge, indicating whether it is directed or undirected. Or something else? It provides a method to determine if the edge is one-way, and a toString method for human-readable representation of the edge type.

A trait representing the type of an edge, indicating whether it is directed or undirected. Or something else? It provides a method to determine if the edge is one-way, and a toString method for human-readable representation of the edge type.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Directed
object Undefined
object Undirected
trait Edges[V, E] extends Pairs[V, EdgeType]

A trait representing a graph structure defined by its edges. The Edges trait provides an abstraction for accessing the sequence of graph edges without requiring direct knowledge of the underlying graph implementation.

A trait representing a graph structure defined by its edges. The Edges trait provides an abstraction for accessing the sequence of graph edges without requiring direct knowledge of the underlying graph implementation.

NOTE: this is not polymorphic in Z like EdgeList CONSIDER making them similar.

Type parameters

E

the type of attributes associated with the edges in the graph.

V

the type of attributes associated with the vertices in the graph.

Attributes

Supertypes
trait Pairs[V, EdgeType]
class Object
trait Matchable
class Any
Known subtypes
class EdgeList[V, E, Z]
abstract class EvaluableGraphNeighboursTraversal[V, T, R](fulfill: V => T)(traversable: Traversable[V])(using random: Random) extends GraphNeighboursTraversal[V, R]

An abstract class that extends the functionality of GraphNeighboursTraversal by incorporating an evaluable mechanism for the vertices of the graph. This class allows the evaluation of graph vertices to produce a value of type T through the provided fulfillment function.

An abstract class that extends the functionality of GraphNeighboursTraversal by incorporating an evaluable mechanism for the vertices of the graph. This class allows the evaluation of graph vertices to produce a value of type T through the provided fulfillment function.

Type parameters

R

The type representing the result of the traversal operation.

T

The type produced when a vertex is evaluated.

V

The type representing a vertex in the graph.

Value parameters

fulfill

A function that maps a vertex of type V to a value of type T.

traversable

A traversable collection of vertices of type V representing the graph.

Attributes

Supertypes
class Object
trait Matchable
class Any
object Graph

Companion object for Graph.

Companion object for Graph.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Graph.type
trait Graph[V] extends Traversable[V]

A trait representing an abstract graph structure composed of vertices.

A trait representing an abstract graph structure composed of vertices.

All traversal methods delegate to the VertexMap which in turn uses the Visitor V1.2.0 typeclass engine (Traversal.dfs / Traversal.bfs). The mutable discovered flag pattern has been removed throughout; visited-node tracking is handled by the immutable VisitedSet[V] inside the engine.

Type parameters

V

the type representing the vertex attributes (invariant).

Attributes

Companion
object
Supertypes
trait Traversable[V]
class Object
trait Matchable
class Any
Known subtypes
class AbstractGraph[V]
class DirectedGraph[V, E]
trait DAG[V, E]
class UndirectedGraph[V, E]
trait EdgeGraph[V, E]
case class GraphException(m: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
abstract class GraphNeighboursTraversal[V, R](traversable: Traversable[V])(using random: Random)

Represents an abstract class for implementing traversal mechanisms on a given traversable structure. The common feature of subclasses is that they all delegate to the graphNeighbours method for the GraphNeighbours typeclass.

Represents an abstract class for implementing traversal mechanisms on a given traversable structure. The common feature of subclasses is that they all delegate to the graphNeighbours method for the GraphNeighbours typeclass.

Type parameters

R

the type representing the result of the traversal

V

the type of the vertices in the traversable structure

Value parameters

random

an implicit random number generator used in the traversal logic

traversable

the traversable structure containing the vertices

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class ListBag[X](xs: Seq[X]) extends AbstractBag[X]

A concrete implementation of the Bag trait that uses a Seq to store elements. This class provides a collection-like structure where elements can be added, and iteration over the stored elements is supported.

A concrete implementation of the Bag trait that uses a Seq to store elements. This class provides a collection-like structure where elements can be added, and iteration over the stored elements is supported.

Type parameters

X

the type of elements contained within the ListBag. The type is covariant to allow ListBag[A] to be used as ListBag[B] if A is a subtype of B.

Value parameters

xs

a sequence of elements of type X, representing the contents of this ListBag.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AbstractBag[X]
trait Bag[X]
trait IterableOnce[X]
class Object
trait Matchable
class Any
Show all
trait OrderableEdge[V, E] extends Edge[V, E], Ordered[Edge[V, E]]

A trait that represents an ordered edge in a graph structure.

A trait that represents an ordered edge in a graph structure.

Extends the Edge interface by providing an ordering mechanism based on the edge's attribute of type E. It also implements the Scala Ordered trait to enable comparisons between edges.

Type parameters

E

the type of the attribute associated with the edge. This attribute is used for determining the order of the edges.

V

the type of the vertices connected by the edge.

Attributes

Supertypes
trait Ordered[Edge[V, E]]
trait Comparable[Edge[V, E]]
trait Edge[V, E]
trait Connexion[V]
trait Attribute[E]
class Object
trait Matchable
class Any
Show all
trait OrderedAttribute[A] extends Attribute[A]

A trait that extends Attribute to enable comparison between attributes of type A and others of compatible types.

A trait that extends Attribute to enable comparison between attributes of type A and others of compatible types.

Type parameters

A

the type of the attribute that this trait represents. Must be comparable using Scala's Ordering.

Attributes

Supertypes
trait Attribute[A]
class Object
trait Matchable
class Any
trait Pairs[V, Z]

A trait that defines a structure for managing pairs of vertices with an associated value.

A trait that defines a structure for managing pairs of vertices with an associated value.

The purpose of Pairs is to represent relationships or connections between pairs of vertices of type V, with an additional associated value of type Z for each pair.

Type parameters

V

the type of the vertices in the pairs.

Z

the type of the additional value associated with each pair of vertices.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Edges[V, E]
class EdgeList[V, E, Z]
class VertexPairList[V]

Provides a utility for constructing a ProtoConnexions instance from a sequence of string ts.

Provides a utility for constructing a ProtoConnexions instance from a sequence of string ts.

This object contains methods to parse input data and generate graph-like structures where vertices are connected by edges derived from parsed values.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ProtoConnexions[V, Z](pairs: Seq[(V, V, Z)]) extends SerializableGraph[V, Unit, Z]

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.

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.

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait SerializableGraph[V, Unit, Z]
class Object
trait Matchable
class Any
Show all

Companion object for RelaxableVertex, providing factory methods.

Companion object for RelaxableVertex, providing factory methods.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class RelaxableVertex[V, R](attribute: V, adjacencies: Adjacencies[V])(var maybeR: Option[R] = ...)(using evidence$1: Ordering[R]) extends AbstractVertex[V], Ordered[RelaxableVertex[V, R]]

A vertex that additionally carries an optional relaxable property maybeR, used in Dijkstra-style shortest-path algorithms.

A vertex that additionally carries an optional relaxable property maybeR, used in Dijkstra-style shortest-path algorithms.

The discovered flag has been removed; only the relaxable property maybeR is retained as mutable state (Dijkstra relaxation requires in-place update semantics on the vertex).

Type parameters

R

the type of the relaxable property; must have an Ordering.

V

the type of the vertex attribute.

Value parameters

adjacencies

the collection of adjacencies.

attribute

the data associated with this vertex.

maybeR

the current best-known cost to reach this vertex, if set.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[RelaxableVertex[V, R]]
trait Comparable[RelaxableVertex[V, R]]
class AbstractVertex[V]
trait Vertex[V]
trait Attribute[V]
class Object
trait Matchable
class Any
Show all
trait SerializableGraph[V, E, Z]

A trait representing a serializable graph structure.

A trait representing a serializable graph structure.

SerializableGraph provides the capability to serialize and traverse through its triplets, where each triplet represents an edge or vertex pair in the graph. Each triplet consists of two vertices (source and target) and an edge attribute connecting them (if any).

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.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class EdgeList[V, E, Z]
class ProtoConnexions[V, Z]
class Triplets[V, E, Z]
class VertexPairList[V]

Object providing factory methods for creating instances of the SerializableGraph 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
Supertypes
class Object
trait Matchable
class Any
Self type
case class SimpleVertex[V](attribute: V, adjacencies: Adjacencies[V]) extends AbstractVertex[V]

A plain vertex carrying only an attribute and adjacencies. Replaces the old DiscoverableVertex now that the discovered flag has been removed.

A plain vertex carrying only an attribute and adjacencies. Replaces the old DiscoverableVertex now that the discovered flag has been removed.

Type parameters

V

the type of the vertex attribute.

Value parameters

adjacencies

the collection of adjacencies.

attribute

the data associated with this vertex.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class AbstractVertex[V]
trait Vertex[V]
trait Attribute[V]
class Object
trait Matchable
class Any
Show all
trait Traversable[V]

Trait to define the behavior of a graph-like structure which can be traversed by dfs, dfsAll, and bfs.

Trait to define the behavior of a graph-like structure which can be traversed by dfs, dfsAll, and bfs.

The traversal engine is provided by Visitor V1.2.0. The mutable discovered flag pattern has been replaced by the immutable VisitedSet[V] typeclass. Callers continue to pass a Visitor in and receive an updated Visitor back; the new typeclass machinery is an implementation detail.

Type parameters

V

the underlying key (attribute) type for a vertex.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait EdgeTraversable[V, E]
trait EdgeGraph[V, E]
class DirectedGraph[V, E]
trait DAG[V, E]
class UndirectedGraph[V, E]
trait Graph[V]
class AbstractGraph[V]
class VertexMap[V]
Show all
case class Triplet[V, E, Z](from: V, to: V, maybeAttribute: Option[E], edgeType: Z)

Represents a triplet structure consisting of two vertices, an optional attribute, and an edge type.

Represents a triplet structure consisting of two vertices, an optional attribute, and an edge type.

Type parameters

E

the type of the optional attribute associated with the edge.

V

the type of the vertices (white and black).

Z

the type representing the edge type.

Value parameters

edgeType

the type of the edge, providing further classification or relationship information.

from

the starting vertex of the triplet.

maybeAttribute

an optional attribute that provides additional metadata for the edge.

to

the ending vertex of the triplet.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Triplets[V, E, Z](triplets: Seq[Triplet[V, E, Z]]) extends SerializableGraph[V, E, Z]

A case class representing a collection of graph triplets.

A case class representing a collection of graph triplets.

Each triplet in the collection encapsulates information about two vertices and their connecting edge (if one exists) in a graph structure. This class extends the SerializableGraph trait, allowing it to support serialization and traversal of the contained triplets.

Type parameters

E

the type associated with the edges in the triplets.

V

the type associated with the vertices in the triplets.

Z

the auxiliary type used within the triplet or graph structure.

Value parameters

triplets

the sequence of triplets representing the graph structure.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SerializableGraph[V, E, Z]
class Object
trait Matchable
class Any
Show all
object Undefined extends EdgeType

Represents the "Undefined" edge type in a graph.

Represents the "Undefined" edge type in a graph.

The Undefined edge type is considered undirected, as determined by the oneWay method, which always returns false. This implies that there is no specific directionality for edges of this type.

This object provides a concrete implementation of the EdgeType trait, overriding the oneWay method to indicate the lack of directionality.

Attributes

Supertypes
trait EdgeType
class Object
trait Matchable
class Any
Self type
Undefined.type
object Undirected extends EdgeType

The Undirected object represents an undirected edge type in a graph. It extends the EdgeType trait and overrides the oneWay method to indicate that edges of this type are not one-way.

The Undirected object represents an undirected edge type in a graph. It extends the EdgeType trait and overrides the oneWay method to indicate that edges of this type are not one-way.

Attributes

Supertypes
trait EdgeType
class Object
trait Matchable
class Any
Self type
Undirected.type
trait Unordered[+T]

A trait representing an abstract data type for unordered collections of elements.

A trait representing an abstract data type for unordered collections of elements.

Type parameters

T

the type of elements contained within this collection (covariant). This trait provides the foundation for implementing unordered data structures by defining fundamental operations such as checking for containment, iterating over elements, and adding new elements. Implementations of this trait must ensure that the order of elements is not relevant or preserved.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Unordered_Bag[T]
class Unordered_Set[T]
object Unordered_Bag

Companion object for the Unordered_Bag class providing factory methods to create instances of Unordered with unordered collections of elements.

Companion object for the Unordered_Bag class providing factory methods to create instances of Unordered with unordered collections of elements.

This object includes utility methods for creating empty unordered bags, bags from sequences, and bags initialized with varargs.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Unordered_Bag[+T](elements: Bag[T]) extends AbstractUnordered[T]

A case class representing an unordered collection of elements in the form of a Set.

A case class representing an unordered collection of elements in the form of a Set.

Type parameters

T

the type of the elements contained in the set.

Value parameters

elements

a set of elements of type T forming the basis of the adjacency set. This class extends the Unordered trait, providing a concrete implementation for unordered data structures. The Unordered_Set is immutable, meaning that any operation resulting in modification (such as adding a new element) will return a new instance of Unordered_Set without changing the original instance.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Unordered[T]
class Object
trait Matchable
class Any
Show all
case class Unordered_Set[T](elements: Set[T]) extends AbstractUnordered[T]

A case class representing an unordered collection of elements in the form of a Set.

A case class representing an unordered collection of elements in the form of a Set.

Type parameters

T

the type of the elements contained in the set.

Value parameters

elements

a set of elements of type T forming the basis of the adjacency set. This class extends the Unordered trait, providing a concrete implementation for unordered data structures. The Unordered_Set is immutable, meaning that any operation resulting in modification (such as adding a new element) will return a new instance of Unordered_Set without changing the original instance.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Unordered[T]
class Object
trait Matchable
class Any
Show all
object Unordered_Set

A companion object for Unordered_Set, providing factory methods to create instances of unordered collections.

A companion object for Unordered_Set, providing factory methods to create instances of unordered collections.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Vertex

Companion object for Vertex, providing factory methods.

Companion object for Vertex, providing factory methods.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Vertex.type
trait Vertex[V] extends Attribute[V]

Represents a vertex in a graph, containing an attribute of type V and a collection of adjacencies denoting its connections to other vertices.

Represents a vertex in a graph, containing an attribute of type V and a collection of adjacencies denoting its connections to other vertices.

Vertex is immutable. The mutable discovered flag has been removed from all implementations; visited-node tracking is now handled by the immutable VisitedSet[V] typeclass inside the Visitor V1.2.0 traversal engine.

Type parameters

V

the type of the attribute associated with the vertex.

Attributes

Companion
object
Supertypes
trait Attribute[V]
class Object
trait Matchable
class Any
Known subtypes
class AbstractVertex[V]
class RelaxableVertex[V, R]
class SimpleVertex[V]
case class VertexMap[V](map: Map[V, Vertex[V]]) extends Traversable[V]

Represents a mapping of vertex attributes to their corresponding vertices within a graph. Provides functionality to manage and traverse vertices via DFS and BFS using the Visitor V1.2.0 typeclass engine.

Represents a mapping of vertex attributes to their corresponding vertices within a graph. Provides functionality to manage and traverse vertices via DFS and BFS using the Visitor V1.2.0 typeclass engine.

The mutable discovered flag pattern has been removed; visited-node tracking is now handled entirely by the immutable VisitedSet[V] inside the traversal engine.

Type parameters

V

the type representing the vertex attributes (invariant).

Value parameters

map

a mapping from vertex attributes to their associated Vertex instances.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Traversable[V]
class Object
trait Matchable
class Any
Show all
object VertexMap

Companion object for VertexMap.

Companion object for VertexMap.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
VertexMap.type
case class VertexPair[V](white: V, black: V) extends Connexion[V]

A case class representing a specific instance of a Connexion between two vertices in a graph.

A case class representing a specific instance of a Connexion between two vertices in a graph.

This class extends the Connexion trait, providing a concrete representation of a connexion between two vertices, identified as white and black. These terms are used to distinguish the two vertices in an abstract way, without implying any ordering or directional meaning.

Type parameters

V

the type of the vertices forming the connection. This parameter allows flexibility to support any user-defined type representing a vertex.

Value parameters

black

the second vertex in the connection, referred to as black.

white

the first vertex in the connection, referred to as white.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Connexion[V]
class Object
trait Matchable
class Any
Show all
case class VertexPairList[V](pairs: Seq[(V, V, EdgeType)]) extends SerializableGraph[V, Unit, EdgeType], Pairs[V, EdgeType]

A case class representing a list of vertex pairs in a graph.

A case class representing a list of vertex pairs in a graph.

CONSIDER eliminate this class.

This class provides a concrete implementation of SerializableGraph and Pairs, enabling functionalities such as accessing the pairs of vertices and transforming these pairs into triplets. Each triplet includes the source vertex, target vertex, and a unit value indicating the absence of an explicit edge attribute.

Type parameters

V

the type of attributes associated with the vertices in the graph.

Value parameters

pairs

a sequence of tuples, where each tuple contains two vertices representing a connection or relationship in the graph.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Pairs[V, EdgeType]
trait SerializableGraph[V, Unit, EdgeType]
class Object
trait Matchable
class Any
Show all

Types

Type alias for an unordered collection of adjacencies for a given vertex type.

Type alias for an unordered collection of adjacencies for a given vertex type.

NOTE: when AdjacencyEdge is used, an Unordered_Set is appropriate (no duplicate edges). When AdjacencyVertex is used, use Unordered_Bag (duplicate vertices are possible).

//@tparam V the type of the vertex attribute.

Attributes

Attributes

Attributes

type ProtoConnexion[V, E] = (E, V, V)

A type alias representing a connection-like structure composed of three elements: an edge of type E and two vertices of type V.

A type alias representing a connection-like structure composed of three elements: an edge of type E and two vertices of type V.

This alias is typically used to describe relationships or connections in graphs or other data structures where a single edge connects two vertices.

// @tparam E the type representing the edge attribute. // @tparam V the type representing the vertex attribute.

Attributes

Value members

Concrete methods

Creates an empty Adjacencies instance backed by an Unordered_Bag.

Creates an empty Adjacencies instance backed by an Unordered_Bag.

Attributes

Creates an empty Adjacencies instance backed by an Unordered_Set.

Creates an empty Adjacencies instance backed by an Unordered_Set.

Attributes