Talk:Graphen und Graphenalgorithmen: Difference between revisions

From Alda
Jump to navigationJump to search
mNo edit summary
No edit summary
 
Line 49: Line 49:
         fdp -Tpng $i -Gcharset=latin1 -o `basename $i .dot`.png
         fdp -Tpng $i -Gcharset=latin1 -o `basename $i .dot`.png
   done;
   done;
Gerichteter Graph:
  digraph {
        1 -> 2
        1 -> 4
        3 -> 2
        3 -> 4
  }
und übersetzt mit <tt>circo</tt>
[[User:Thorben|Thorben]]
[[User:Thorben|Thorben]]

Latest revision as of 17:14, 18 June 2008

Habe die Graphen k1 bis k5 mit Graphviz gezeichnet und die Bilder gegen die ASCII Art ausgetauscht.

Hier meine Quelltext: k1.dot:

 graph {
       1
 }

k2.dot:

 graph {
       1 -- 2
 }

k3.dot:

 graph {
       1 -- 2
       2 -- 3
       3 -- 1
 }

k4.dot:

 graph {
       1 -- 2 [weight = 10]
       1 -- 3
       2 -- 3 [weight = 10]
       3 -- 4 [weight = 10]
       4 -- 1 [weight = 10]
       4 -- 2
 }

k5.dot

 graph {
       1 -- 2
       2 -- 3
       3 -- 4
       4 -- 5
       5 -- 1
       1 -- 3
       1 -- 4
       2 -- 4
       2 -- 5
       5 -- 3
 }

Generierung der Graphiken mit:

 #!/bin/bash
 for i in *.dot; do
       fdp -Tpng $i -Gcharset=latin1 -o `basename $i .dot`.png
 done;

Gerichteter Graph:

 digraph {
       1 -> 2
       1 -> 4
       3 -> 2
       3 -> 4
 }

und übersetzt mit circo Thorben