aonyx/graph/edge
Types
Represents an edge going from one node to another.
pub type Edge(key, label) {
Edge(
from: key,
to: key,
label: option.Option(label),
weight: option.Option(Float),
)
}
Constructors
-
Edge( from: key, to: key, label: option.Option(label), weight: option.Option(Float), )
Values
pub fn new(from: a, to: a) -> Edge(a, b)
Creates an edge with the given from and to node keys, without label or weight.
pub fn with_label(edge: Edge(a, b), label: b) -> Edge(a, b)
Sets the label of an edge.
pub fn with_weight(edge: Edge(a, b), weight: Float) -> Edge(a, b)
Sets the weight of an edge.
pub fn without_weight(edge: Edge(a, b)) -> Edge(a, b)
Clears the weight of an edge.