public class ClassicalGraphs
extends java.lang.Object
Class
ClassicalGraphs
contains methods for easily
obtaining classical graphs (paths, cycles, cliques, Petersen graph...)Modifier and Type | Method and Description |
---|---|
Grph |
clique(int n) |
static Grph |
completeBipartiteGraph(int m,
int n)
Constructs the complete bipartite graph Km,n.
|
static Grph |
completeGraph(int n)
Constructs the complete graph (also known as clique) on n
vertices, Kn.
|
static Grph |
cycle(int n)
Constructs the cycle graph on n vertices, Cn.
|
static Grph |
grid(int i,
int j) |
static Grph |
path(int n)
Constructs the path graph on n vertices, Pn.
|
static Grph |
PetersenGraph()
Constructs the Petersen graph.
|
static Grph |
randomBipartiteGraph(int m,
int n,
double p)
Constructs a random bipartite graph.
|
public Grph clique(int n)
public static Grph path(int n)
n
- the number of vertices of the pathn
is non-positivepublic static Grph cycle(int n)
n
- the number of vertices of the cyclen
is non-positivepublic static Grph completeGraph(int n)
n
- the number of vertices of the complete graphn
is non-positivepublic static Grph completeBipartiteGraph(int m, int n)
m
- the number of vertices in the left siden
- the number of vertices in the right sidem
or n
is
negativepublic static Grph randomBipartiteGraph(int m, int n, double p)
p
m
- the number of vertices in the left siden
- the number of vertices in the right sidep
- the probability for an edge to existpublic static Grph PetersenGraph()
public static Grph grid(int i, int j)