public static class IslandGA.Graph
extends java.lang.Object
Constructor and Description |
---|
IslandGA.Graph(int n)
Creates a graph
|
Modifier and Type | Method and Description |
---|---|
static IslandGA.Graph |
buildFull(int n) |
static IslandGA.Graph |
buildGrid(int l,
int m,
boolean bidirectional) |
static IslandGA.Graph |
buildRing(int n,
boolean bidirectional)
Builds a ring
|
boolean |
getLink(int from,
int to)
Return the link between two nodes
|
void |
setLink(int from,
int to,
boolean flag)
Sets a link between two nodes
|
public void setLink(int from, int to, boolean flag)
from
- starting nodeto
- ending nodeflag
- true, if there a link between the two nodespublic boolean getLink(int from, int to)
from
- starting nodeto
- ending nodepublic static IslandGA.Graph buildRing(int n, boolean bidirectional)
n
- number of nodesbidirectional
- true, if for each edge, there is also its oppositepublic static IslandGA.Graph buildGrid(int l, int m, boolean bidirectional)
public static IslandGA.Graph buildFull(int n)