Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 764209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:41:16+00:00 2026-05-14T16:41:16+00:00

I have to draw a small finite state machine that has some reflexive transitions

  • 0

I have to draw a small finite state machine that has some reflexive transitions (meaning the start and the end state of the transition are equal.

The problem is that rendering that in Graphviz has ugly results.

digraph finite_state_machine {  
    edge [fontsize=11];
    
    S0 -> S0 [label = "td=1\n-/e2"];   
    S0 -> S1 [label = "td=3 \n-/e3" ];  
    S1 -> S0 [label = "td=3\n-/-\nt=0"];  
    S0 -> S2 [label = "P:i1/e4"];  
    S2 -> S0 [label = "td=0\n-/-" ];  
    S0 -> S0 [label = "i1/e1\ntd+=1"];  
}

A rendering of the state machine

Is there a way to make this look a little better?

BTW: I tried head/tailport but they don’t work on my version of Graphviz (1.13 on Mac OS X)

I am not limited to the dot engine, I only want a nice looking graph and don’t care about the renderer/language.

Thanks a lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:41:16+00:00Added an answer on May 14, 2026 at 4:41 pm

    So, if found a workaround, but not really an answer to my problem.
    The trick is to have an invisible node that connections to the starting state. the starting state is then not the top of the hierarchy and one has a little bit more freedom in placing the nodes. Also then the head/tailport attributes work as they should.
    The result is – if not a pretty as I would like it to be – ok to look at.

    digraph finite_state_machine {  
      edge [fontsize=7];
      fontsize = 11;
      rankdir=LR;
      {rank = same;null}
      {rank = same; S0}
      {rank = same; S1 S2}
      nodesep = 1;
      ranksep = 1;
    
      null [shape = plaintext label=""];
      null -> S0;
      S0 -> S0 [label = "td=1\n-/e2", tailport = n, headport = n]; 
      S0 -> S1 [label = "td=3 \n-/e3" ];
      S1 -> S0 [label = "td=3\n-/-\nt=0"];
      S0 -> S2 [label = "P:i1/e4"];
      S2 -> S0 [label = "td=0\n-/-" ];
      S0 -> S0 [label = "i1/e1\ntd+=1" headport = s tailport = s];
    }

    a rendering of the state machine http://img532.imageshack.us/img532/4083/previewd.png

    While this works (for this particular example) I would still very much like some advice on dot/Graphviz or an alternative for rendering finite state machines in a pleasing way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small (6x9) graphic that I want to draw on a CButton.
I have a ImageView and draw some things on that view. Now I want
I have a small app that allows the user to draw on the screen
I have a JLabel that I need to draw off screen with some Transforms
I have various documents some are large some are small, we have to draw
I have a small app that has a Render thread. All this thread does
I have a small application that uses a DrawingArea to draw a simple map
I have two methods that draw a rotated rectangle on the screen. RenderMethod1 renders
I have a function that draw an image on graphics: private void DrawSmallImage(Graphics g)
I have a View with few subviews in it and I draw some sublayers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.