UndirectedEdge

com.phasmidsoftware.gryphon.adjunct.UndirectedEdge
case class UndirectedEdge[V, E](attribute: E, white: V, black: V) extends Edge[V, E]

Represents an undirected edge in a graph structure, connecting two vertices (white and black) equally, without a defined direction, and carrying an associated attribute.

Type parameters

E

the type of the attribute associated with the edge.

V

the type of the vertex attributes connected by the edge.

Value parameters

attribute

a value representing additional information or weight associated with the edge.

black

the other vertex connected by the undirected edge.

white

one of the vertices connected by the undirected edge.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Edge[V, E]
trait Connexion[V]
trait Attribute[E]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Returns the type of the edge as an instance of EdgeType.

Returns the type of the edge as an instance of EdgeType.

Attributes

Returns

the edge type, which is Undirected for this implementation.

def either: V

Retrieves one of the vertices connected by the undirected edge.

Retrieves one of the vertices connected by the undirected edge.

Attributes

Returns

the vertex white, one of the two vertices connected by this undirected edge.

override def equals(obj: Any): Boolean

Symmetric equality: UndirectedEdge(a, u, v) == UndirectedEdge(a, v, u). The default case class equals treats white and black as ordered, which violates the mathematical definition of an undirected edge.

Symmetric equality: UndirectedEdge(a, u, v) == UndirectedEdge(a, v, u). The default case class equals treats white and black as ordered, which violates the mathematical definition of an undirected edge.

Attributes

Definition Classes
Equals -> Any
override def hashCode: Int

hashCode consistent with symmetric equals — must be order-independent.

hashCode consistent with symmetric equals — must be order-independent.

Attributes

Definition Classes
Any
def other(v: V): V

Retrieves the vertex at the opposite end of the edge relative to the given vertex.

Retrieves the vertex at the opposite end of the edge relative to the given vertex.

Value parameters

v

the vertex for which the opposite vertex is to be determined.

Attributes

Returns

the vertex at the other end of the edge.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product