V
- vertex typepublic class SimpleArc<V> extends Object implements WeightedArc<V>
Constructor and Description |
---|
SimpleArc(V head,
V tail)
Construct a simple arc.
|
SimpleArc(V head,
V tail,
double cost)
Construct a simple arc.
|
Modifier and Type | Method and Description |
---|---|
double |
cost()
Gets the cost or weight of this edge.
|
V |
head() |
V |
neighbor(V vertex)
Gets the neighboring vertex connected to
vertex . |
Set<V> |
neighbors(V vertex)
Gets the set of neighboring vertices connected to
vertex . |
V |
tail()
Get the tail of this arc.
|
String |
toString() |
Set<V> |
vertices()
Gets the set of vertices associated with the edge.
|
public SimpleArc(V head, V tail, double cost)
head
- head vertextail
- tail vertexcost
- the edge costpublic double cost()
WeightedEdge
cost
in interface WeightedEdge<V>
public V neighbor(V vertex)
Edge
vertex
.public Set<V> neighbors(V vertex)
HyperEdge
vertex
.public Set<V> vertices()
HyperEdge
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.