Package smile.graph

Class Graph.Edge

java.lang.Object
smile.graph.Graph.Edge
Enclosing interface:
Graph

public static class Graph.Edge extends Object
Graph edge.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The id of one vertex connected by this edge.
    final int
    The id of the other vertex connected by this edge.
    double
    The weight of edge.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Edge(int v1, int v2, double weight)
    Constructor.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • v1

      public final int v1
      The id of one vertex connected by this edge. For directed graph, this is the tail of arc.
    • v2

      public final int v2
      The id of the other vertex connected by this edge. For directed graph, this is the head of arc.
    • weight

      public double weight
      The weight of edge. For unweighted graph, this is always 1.
  • Constructor Details

    • Edge

      public Edge(int v1, int v2, double weight)
      Constructor.
      Parameters:
      v1 - the vertex id.
      v2 - the other vertex id.
      weight - the weight of edge.