| 1 |
digraph { |
| 2 |
layout=dot; |
| 3 |
|
| 4 |
// default values |
| 5 |
node [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=white, fontsize=8]; |
| 6 |
graph [fontname="sans-serif"]; // must be specified separately |
| 7 |
edge [fontname="sans-serif"]; // must be specified separately |
| 8 |
|
| 9 |
// an unobtrusive background color |
| 10 |
pad="1.0, 0.5"; |
| 11 |
bgcolor=whitesmoke; |
| 12 |
|
| 13 |
// layout of edges and nodes |
| 14 |
splines=ortho; |
| 15 |
nodesep=0.3; |
| 16 |
ranksep=0.3; |
| 17 |
|
| 18 |
// nodes |
| 19 |
a1[label="INITIALIZE t := 0"]; |
| 20 |
a2[label="INITIALIZE P(t)"]; |
| 21 |
a3[label="evaluate FITNESS of P(t)"]; |
| 22 |
a4[shape="diamond", label="STOPPING CRITERION"; width=4]; |
| 23 |
|
| 24 |
// connect 'end' node with 'a9' node (bottom of figure) |
| 25 |
{ |
| 26 |
rank=same; |
| 27 |
a9[label="t := t + 1"]; |
| 28 |
// end-symbol similar to UML notation |
| 29 |
end[shape=doublecircle, label="end", width=0.5]; |
| 30 |
} |
| 31 |
|
| 32 |
a5[label="P'(t) := RECOMBINATION{P(t)}"]; |
| 33 |
a6[label="P''(t) := MUTATION{P'(t)}"]; |
| 34 |
a7[label="P(t+1) := SELECTION{P''(t) + P(t)}"]; |
| 35 |
a8[label="evaluate FITNESS of P''(t)"]; |
| 36 |
|
| 37 |
// edges |
| 38 |
a1 -> a2 -> a3 -> a4; |
| 39 |
// these trailing spaces output as "nbsp" (UTF8 NO-BREAK SPACE) |
| 40 |
a4 -> a5[xlabel="false ", fontsize=10]; |
| 41 |
a4 -> end[xlabel="true ", fontsize=10]; |
| 42 |
a5 -> a6 -> a7 -> a8 -> a9; |
| 43 |
a4 -> a9 [dir=back]; |
| 44 |
|
| 45 |
// explain the notation |
| 46 |
expl [shape=plaintext, fontsize=10, width=3.2, fillcolor=whitesmoke, |
| 47 |
label="P(t): generation of ancestors at a time t\lP''(t): generation of descendants at a time t\l"]; |
| 48 |
|
| 49 |
} |