org._3pq.jgrapht.generate

Class RingGraphGenerator

Implemented Interfaces:
GraphGenerator

public class RingGraphGenerator
extends java.lang.Object
implements GraphGenerator

Generates a ring graph of any size. A ring graph is a graph that contains a single cycle that passes through all its vertices exactly once. For a directed graph, the generated edges are oriented consistently around the ring.
Author:
John V. Sichi
Since:
Sep 16, 2003

Constructor Summary

RingGraphGenerator(int size)
Construct a new RingGraphGenerator.

Method Summary

void
generateGraph(Graph target, VertexFactory vertexFactory, Map resultMap)

Constructor Details

RingGraphGenerator

public RingGraphGenerator(int size)
Construct a new RingGraphGenerator.
Parameters:
size - number of vertices to be generated

Method Details

generateGraph

public void generateGraph(Graph target,
                          VertexFactory vertexFactory,
                          Map resultMap)
Specified by:
generateGraph in interface GraphGenerator