org._3pq.jgrapht.generate
Class WheelGraphGenerator
java.lang.Object
org._3pq.jgrapht.generate.WheelGraphGenerator
- GraphGenerator
public class WheelGraphGenerator
extends java.lang.Object
Generates a
wheel
graph of any size. Reminding a bicycle wheel, a wheel graph has a hub
vertex in the center and a rim of vertices around it that are connected to
each other (as a ring). The rim vertices are also connected to the hub with
edges that are called "spokes".
HUB_VERTEX
public static final String HUB_VERTEX
Role for the hub vertex.
WheelGraphGenerator
public WheelGraphGenerator(int size)
Creates a new WheelGraphGenerator object. This constructor is more
suitable for undirected graphs, where spokes' direction is meaningless.
In the directed case, spokes will be oriented from rim to hub.
size
- number of vertices to be generated.
WheelGraphGenerator
public WheelGraphGenerator(int size,
boolean inwardSpokes)
Construct a new WheelGraphGenerator.
size
- number of vertices to be generated.inwardSpokes
- if true
and graph is directed, spokes
are oriented from rim to hub; else from hub to rim.