Skip to main content

Edge

Module: opytimizer.core.graph.edge

A connection between two GraphNodes.

Constructor​

Edge(source: opytimizer.core.graph.node.GraphNode, target: opytimizer.core.graph.node.GraphNode, weight: Optional[float] = None, directed: bool = False) -> None

Parameters​

ParameterTypeDefaultDescription
sourceopytimizer.core.graph.node.GraphNodeOrigin node.
targetopytimizer.core.graph.node.GraphNodeDestination node.
weightOptional[float]NoneOptional numeric weight/cost associated with the edge.
directedboolFalseWhether this edge should be treated as one-way (source -> target only) or two-way.