Class Edge

An edge connects two vertices.

Hierarchy (view full)

Methods

  • Sets some attribute on the object.

    Parameters

    • key: string

    Returns string

  • Gets the cost for this edge. Defaults to 1.

    Returns number

    Edge cost.

  • Gets the id for this Edge. *

    Returns string

    Edge id.

  • Returns a string representation of the Edge. *

    Returns string

    Edge dumped to a string.

  • Gets whether or not the Edge is directed.

    Returns boolean

    True if the Edge is directed (unidirectional), false otherwise.

  • Gets some attribute from the object.

    Parameters

    • key: string
    • value: string

    Returns void

  • Sets the cost for this edge.

    Parameters

    • c: number

      Edge cost.

    Returns void

  • Sets whether or not the Edge is directed.

    Parameters

    • directed: boolean

    Returns void

Properties

cost: number

Edge cost. Defaults to 1.

Underlying data for the object.

directed: boolean

Whether or not the edge is directed. Defaults to true.

graph: Graph

The underlying graph.

id: string

ID of the edge. Your code should never change this value.

source: Vertex

Source of the Edge.

target: Vertex

Target of the Edge.

type: string

Type of the object

Version :