PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, June 28, 2022

[FIXED] How can I make a circular graph in Graphviz?

 June 28, 2022     fsm, graph, graphviz     No comments   

Issue

I have this following graph in graphviz:

enter image description here

That is generated from this code:

digraph finite_state_machine {
    rankdir=TB;
    node [shape = none]; Start;
    node [shape = circle];
    nodesep=.5;
    Start -> A;
    
    A->B
    B->C
    C->D
    D->E
    E->F
    F->G
    G->H
    H->I
    I->A

    {rank = same; A B C D}
    {rank = same; E}
    {rank = same; F G H I}
}

How can I change the direction of those bottom lines in order to make it look like that? enter image description here


Solution

An example with 8 nodes (as from your drawing it was not clear where to put the 9-th):

digraph finite_state_machine {
    rankdir=TB;
    node [shape = none]; Start;
    node [shape = circle];
    nodesep=.5;
    Start -> A;
    
    A->B
    B->C
    C->D
    D->E
    F->E [dir=back]
    G->F [dir=back]
    H->G [dir=back]
    A->H [dir=back]
   

    {rank = same; A B C }
    {rank = same;  E F G }
}

enter image description here



Answered By - albert
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing