V
- graph vertex typeE
- graph edge typepublic class GeneralizedPetersenGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,List<V>>
NamedGraphGenerator
.Modifier and Type | Field and Description |
---|---|
String |
REGULAR
Key used to access the regular polygon vertices in the resultMap
|
String |
STAR
Key used to access the star polygon vertices in the resultMap
|
Constructor and Description |
---|
GeneralizedPetersenGraphGenerator(int n,
int k)
Constructs a GeneralizedPetersenGraphGenerator used to generate a Generalized Petersen graphs
$GP(n,k)$.
|
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
Map<String,List<V>> resultMap)
Generates the Generalized Petersen Graph
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateGraph, generateGraph, generateGraph
public final String STAR
public final String REGULAR
public GeneralizedPetersenGraphGenerator(int n, int k)
n
- size of the regular polygon (cycle graph $C_n$)k
- size of the star polygon ${n,k}$public void generateGraph(Graph<V,E> target, Map<String,List<V>> resultMap)
generateGraph
in interface GraphGenerator<V,E,List<V>>
target
- receives the generated edges and vertices; if this is non-empty on entry, the
result will be a disconnected graph since generated elements will not be connected to
existing elementsresultMap
- if non-null, the resultMap contains a mapping from the key "star" to a list
of vertices constituting the star polygon, as well as a key "regular" which maps to a
list of vertices constituting the regular polygon.Copyright © 2018. All rights reserved.