pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jürgen Purtz <juergen@purtz.de>
To: Pg Docs <pgsql-docs@lists.postgresql.org>
Subject: Consolidation of first figures
Date: Mon, 2 Sep 2019 16:47:45 +0200
Message-ID: <99b6d626-cca9-0722-3e77-e0cb188a13a3@purtz.de> (raw)

We plan to integrate figures into version 12. Currently there are 2 
resp. 3 figures in git (BETA3 / master). This may be intended - or not. 
Additionally there are some patches in the mailing list.

The attached patch summarizes everything for an integration into BETA3: 
3 figures, common attributes (fonts, sizes, colors) and structure for 
.gv files, changed texts in gin.gv, Makefile, README.

Jürgen Purtz

Attachments:

figures_12beta3.patch (text/x-patch, 10.3K) download diff --git a/doc/src/sgml/geqo.sgml b/doc/src/sgml/geqo.sgml index 5120dfbb42..81cd84155a 100644 --- a/doc/src/sgml/geqo.sgml +++ b/doc/src/sgml/geqo.sgml @@ -84,59 +84,25 @@ Through simulation of the evolutionary operations <firstterm>recombination</firstterm>, <firstterm>mutation</firstterm>, and <firstterm>selection</firstterm> new generations of search points are found - that show a higher average fitness than their ancestors. + that show a higher average fitness than their ancestors. <xref linkend="geqo-figure"/> + illustrates in which order and how long the three steps are processed. </para> + <figure id="geqo-figure"> + <title>Structure of a Genetic Algorithm</title> + <mediaobject> + <imageobject> + <imagedata fileref="images/genetic-algorithm.svg" format="SVG" width="100%"/> + </imageobject> + </mediaobject> + </figure> + <para> According to the <systemitem class="resource">comp.ai.genetic</systemitem> <acronym>FAQ</acronym> it cannot be stressed too strongly that a <acronym>GA</acronym> is not a pure random search for a solution to a problem. A <acronym>GA</acronym> uses stochastic processes, but the result is distinctly non-random (better than random). </para> - - <figure id="geqo-diagram"> - <title>Structured Diagram of a Genetic Algorithm</title> - - <informaltable frame="none"> - <tgroup cols="2"> - <tbody> - <row> - <entry>P(t)</entry> - <entry>generation of ancestors at a time t</entry> - </row> - - <row> - <entry>P''(t)</entry> - <entry>generation of descendants at a time t</entry> - </row> - </tbody> - </tgroup> - </informaltable> - -<literallayout class="monospaced"> -+=========================================+ -|&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Algorithm GA &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;| -+=========================================+ -| INITIALIZE t := 0 | -+=========================================+ -| INITIALIZE P(t) | -+=========================================+ -| evaluate FITNESS of P(t) | -+=========================================+ -| while not STOPPING CRITERION do | -| +-------------------------------------+ -| | P'(t) := RECOMBINATION{P(t)} | -| +-------------------------------------+ -| | P''(t) := MUTATION{P'(t)} | -| +-------------------------------------+ -| | P(t+1) := SELECTION{P''(t) + P(t)} | -| +-------------------------------------+ -| | evaluate FITNESS of P''(t) | -| +-------------------------------------+ -| | t := t + 1 | -+===+=====================================+ -</literallayout> - </figure> </sect1> <sect1 id="geqo-pg-intro"> diff --git a/doc/src/sgml/images/Makefile b/doc/src/sgml/images/Makefile index 1e7993020b..f9e356348b 100644 --- a/doc/src/sgml/images/Makefile +++ b/doc/src/sgml/images/Makefile @@ -3,6 +3,7 @@ # see README in this directory about image handling ALL_IMAGES = \ + genetic-algorithm.svg \ gin.svg \ pagelayout.svg diff --git a/doc/src/sgml/images/README b/doc/src/sgml/images/README index 07c4580255..c451d4bca4 100644 --- a/doc/src/sgml/images/README +++ b/doc/src/sgml/images/README @@ -13,7 +13,8 @@ involve diffable source files. These tools are acceptable: - Graphviz (https://graphviz.org/) -- Ditaa (http://ditaa.sourceforge.net/) +- Ditaa (https://github.com/stathissideris/ditaa), version 0.11 or + higher. Previous versions does not support SVG. We use SVG as the format for integrating the image into the ultimate output formats of the documentation, that is, HTML, PDF, and others. diff --git a/doc/src/sgml/images/genetic-algorithm.gv b/doc/src/sgml/images/genetic-algorithm.gv new file mode 100644 index 0000000000..fd4c982e91 --- /dev/null +++ b/doc/src/sgml/images/genetic-algorithm.gv @@ -0,0 +1,49 @@ +digraph { + + layout=dot; + + // default values + node [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=white, width=2.2, fontsize=8]; + graph [fontname="sans-serif"]; // must be specified separately + edge [fontname="sans-serif"]; // must be specified separately + + // an unobtrusive background color + pad="1.0, 0.5"; + bgcolor=whitesmoke; + + // layout of edges and nodes + splines=ortho; + nodesep=0.3; + ranksep=0.3; + + // nodes + a1[label="INITIALIZE t := 0"]; + a2[label="INITIALIZE P(t)"]; + a3[label="evaluate FITNESS of P(t)"]; + a4[shape="diamond", label="STOPPING CRITERION"; width=4]; + + // connect 'end' node with 'a9' node (bottom of figure) + { + rank=same; + a9[label="t := t + 1"]; + // end-symbol similar to UML notation + end[shape=doublecircle, label="end", width=0.5]; + } + + a5[label="P'(t) := RECOMBINATION{P(t)}"]; + a6[label="P''(t) := MUTATION{P'(t)}"]; + a7[label="P(t+1) := SELECTION{P''(t) + P(t)}"]; + a8[label="evaluate FITNESS of P''(t)"]; + + // edges + a1 -> a2 -> a3 -> a4; + a4 -> a5[xlabel="false ", fontsize=10]; + a4 -> end[xlabel="true ", fontsize=10]; + a5 -> a6 -> a7 -> a8 -> a9; + a4 -> a9 [dir=back]; + + // explain the notation + expl [shape=plaintext, fontsize=10, width=3.2, fillcolor=whitesmoke, + label="P(t): generation of ancestors at a time t\lP''(t): generation of descendants at a time t\l"]; + +} diff --git a/doc/src/sgml/images/gin.gv b/doc/src/sgml/images/gin.gv index 097e91029a..24604df0d5 100644 --- a/doc/src/sgml/images/gin.gv +++ b/doc/src/sgml/images/gin.gv @@ -1,93 +1,115 @@ digraph "gin" { - layout=dot; - node [label="", shape=box, style=filled, fillcolor=gray, width=1.4]; - - m1 [label="meta page"]; - - subgraph cluster01 { - label="entry tree"; - subgraph egroup1 { - rank=same; - e1; - } - subgraph egroup2 { - rank=same; - e2 -> e3 -> e4; - } - subgraph egroup3 { - rank=same; - e5 -> e6 -> e7 -> e8 -> e9; - } - e1 -> e4; - e1 -> e3; - e1 -> e2; - e2 -> e5; - e2 -> e6; - e3 -> e7; - e4 -> e8; - e4 -> e9; - - e6 [fillcolor=green, label="posting list"]; - e8 [fillcolor=green, label="posting list"]; - e9 [fillcolor=green, label="posting list"]; - } - - subgraph cluster02 { - label="posting tree"; - subgraph pgroup1 { - rank=same; - p1; - } - subgraph pgroup2 { - rank=same; - p2 -> p3; - } - p1 -> p2; - p1 -> p3; - - p2 [fillcolor=green, label="heap ptr"]; - p3 [fillcolor=green, label="heap ptr"]; - } - - subgraph cluster03 { - label="posting tree"; - subgraph pgroup3 { - rank=same; - p4; - } - - p4 [fillcolor=green, label="heap ptr"]; - } - - subgraph cluster04 { - label="posting tree"; - subgraph pgroup4 { - rank=same; - p5; - } - subgraph pgroup5 { - rank=same; - p6 -> p7; - } - p5 -> p6; - p5 -> p7; - - p6 [fillcolor=green, label="heap ptr"]; - p7 [fillcolor=green, label="heap ptr"]; - } - - subgraph cluster05 { - label="pending list"; - node [style=filled, fillcolor=red]; - n1 -> n2 -> n3 -> n4; - } - - m1 -> e1; - e5 -> p1; - e7 -> p4; - e7 -> p5; - m1 -> n1; - - e5 [style=filled, fillcolor=green4]; - e7 [style=filled, fillcolor=green4]; + + layout=dot; + + // default values + node [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=lightgray, width=1.4]; + graph [fontname="sans-serif"]; // must be specified separately + edge [fontname="sans-serif"]; // must be specified separately + + // an unobtrusive background color + pad="1.0, 0.5"; + bgcolor=whitesmoke; + + // The top node + m1 [label="meta page", style=filled, fillcolor=beige]; + + // other nodes + subgraph cluster01 { + bgcolor=white; + label="entry tree"; + subgraph egroup1 { + rank=same; + e1; + } + subgraph egroup2 { + rank=same; + e2 -> e3 -> e4; + } + subgraph egroup3 { + rank=same; + e5 -> e6 -> e7 -> e8 -> e9; + } + e1 -> e4; + e1 -> e3; + e1 -> e2; + e2 -> e5; + e2 -> e6; + e3 -> e7; + e4 -> e8; + e4 -> e9; + + e5 [fillcolor=cyan]; + e6 [fillcolor=cyan]; + e7 [fillcolor=cyan]; + e8 [fillcolor=cyan]; + e9 [fillcolor=cyan]; + + } + + subgraph cluster02 { + bgcolor=white; + label="posting tree"; + subgraph pgroup1 { + p1; + } + subgraph pgroup2 { + rank=same; + p2 -> p3; + } + p1 -> p2; + p1 -> p3; + + p2 [fillcolor=deepskyblue]; + p3 [fillcolor=deepskyblue]; + } + + subgraph cluster03 { + bgcolor=white; + label="posting tree"; + subgraph pgroup3 { + p4; + } + + p4 [fillcolor=deepskyblue]; + } + + subgraph cluster04 { + bgcolor=white; + label="posting tree"; + subgraph pgroup4 { + p5; + } + subgraph pgroup5 { + rank=same; + p6 -> p7; + } + p5 -> p6; + p5 -> p7; + + p6 [fillcolor=deepskyblue]; + p7 [fillcolor=deepskyblue]; + } + + subgraph cluster05 { + bgcolor=white; + label="pending list"; + node [fillcolor=wheat, label="pending entries", width=1.8]; + n1 -> n2 -> n3 -> n4 -> n5; + } + + m1 -> e1; + e5 -> p1; + e7 -> p4; + e7 -> p5; + m1 -> n1; + + // Explanations + expl_1 [shape=plaintext, width=2.5, label="Internal tree node"]; + expl_2 [shape=plaintext, fillcolor=cyan, width=5.2, label="<posting list> and/or pointer to <posting tree>"]; + expl_3 [shape=plaintext, fillcolor=deepskyblue, width=2.0, label="Only <posting list>"]; + p6 -> expl_1 [style=invis]; + p6 -> expl_2 [style=invis]; + p6 -> expl_3 [style=invis]; + }

view thread (2+ messages)  latest in thread

Message-ID: <99b6d626-cca9-0722-3e77-e0cb188a13a3@purtz.de>
Permalink:  ../99b6d626-cca9-0722-3e77-e0cb188a13a3@purtz.de/
Also on:    postgresql.org/message-id/99b6d626-cca9-0722-3e77-e0cb188a13a3@purtz.de

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: juergen@purtz.de, pgsql-docs@lists.postgresql.org
  Subject: Re: Consolidation of first figures
  In-Reply-To: <99b6d626-cca9-0722-3e77-e0cb188a13a3@purtz.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox