V - graph vertex typeE - graph edge typepublic class GeneralizedPetersenGraphGenerator<V,E> extends java.lang.Object implements GraphGenerator<V,E,java.util.List<V>>
NamedGraphGenerator.| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
REGULAR
Key used to access the regular polygon vertices in the resultMap
|
java.lang.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,
java.util.Map<java.lang.String,java.util.List<V>> resultMap)
Generates the Generalized Petersen Graph
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateGraphpublic final java.lang.String STAR
public final java.lang.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, java.util.Map<java.lang.String,java.util.List<V>> resultMap)
generateGraph in interface GraphGenerator<V,E,java.util.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 © 2019. All Rights Reserved.