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 279067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:00:04+00:00 2026-05-12T05:00:04+00:00

I have a number of relatively simple (auto-generated) graphs in graphviz dot format. These

  • 0

I have a number of relatively simple (auto-generated) graphs in graphviz dot format. These show the path through a state machine, but dot has a slightly confusing habit of deciding that two nodes must be on the same rank when I would like the graph to be in state order. I’ve tried a lot of settings (including the :n and :s and the weight listed below), but I cannot persuade dot to place the Third State above the Fourth State.

I have this problem with a lot of graphs: there seems to be something internal to dot that decides that it would be better if two nodes were on the same rank and there’s nothing that can be done to override it. I’ve even had code that specifies that one node should be a rank=sink, but dot has decided to put another node below it anyway.

Is there any way to suggest to dot that it’s more important that the nodes are in order than any other constraint?

The code that was used to generate the graph looks like this:

digraph {
    ERROR [label="Error"];
    FirstSTATE [label="Initial State" URL="\ref FirstSTATE"];
    FirstSTATE -> SecondSTATE;
    SecondSTATE [label="Second State" URL="\ref SecondSTATE"];
    SecondSTATE -> ThirdSTATE;
    ThirdSTATE [label="Third State" URL="\ref ThirdSTATE"];
    FourthSTATE [label="Fouth State?" shape="diamond"];
    ThirdSTATE:s -> FourthSTATE:n [weight=50];
    FourthSTATE -> FifthSTATE [label="Yes" ];
    FourthSTATE -> ThirdSTATE [label="No"];
    FifthSTATE [label="Fifth State" URL="\ref FifthSTATE"];
    SixthSTATE [label="Sixth State?" shape="diamond"];
    SixthSTATE -> ERROR [label="Yes" ];
    SixthSTATE -> SeventhSTATE [label="No"];
    FifthSTATE -> SixthSTATE;
    SeventhSTATE [label="Seventh State" URL="\ref SeventhSTATE"];
    SeventhSTATE -> EighthSTATE;
    EighthSTATE [label="Eighth State" URL="\ref EighthSTATE"];
    NinthSTATE [label="Ninth State?" shape="diamond"];
    NinthSTATE -> TenthSTATE [label="Yes" ];
    NinthSTATE -> EighthSTATE [label="No"];
    EighthSTATE -> NinthSTATE;
    TenthSTATE [label="Tenth State" URL="\ref TenthSTATE"];
    EleventhSTATE [label="Eleventh State?" shape="diamond"];
    EleventhSTATE -> ERROR [label="Yes" ];
    EleventhSTATE -> TwelfthSTATE [label="No" ];
    TenthSTATE -> EleventhSTATE;
    TwelfthSTATE [label="Twelfth State" URL="\ref TwelfthSTATE"];
}

The graph currently looks like this:
Dot Graph

  • 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-12T05:00:04+00:00Added an answer on May 12, 2026 at 5:00 am

    Use “constraint=false”.

    http://www.graphviz.org/doc/info/attrs.html#d:constraint

    In your graph:

    FourthSTATE -> ThirdSTATE [label="No" constraint=false] ;
    

    You’ll get:

    digraph {
        ERROR [label="Error"];
        FirstSTATE [label="Initial State" URL="\ref FirstSTATE"];
        FirstSTATE -> SecondSTATE;
        SecondSTATE [label="Second State" URL="\ref SecondSTATE"];
        SecondSTATE -> ThirdSTATE;
        ThirdSTATE [label="Third State" URL="\ref ThirdSTATE"];
        FourthSTATE [label="Fouth State?" shape="diamond"];
        ThirdSTATE -> FourthSTATE;
        FourthSTATE -> FifthSTATE [label="Yes" ];
        FourthSTATE -> ThirdSTATE [label="No" constraint=false] ;
        FifthSTATE [label="Fifth State" URL="\ref FifthSTATE"];
        SixthSTATE [label="Sixth State?" shape="diamond"];
        SixthSTATE -> ERROR [label="Yes" ];
        SixthSTATE -> SeventhSTATE [label="No"];
        FifthSTATE -> SixthSTATE;
        SeventhSTATE [label="Seventh State" URL="\ref SeventhSTATE"];
        SeventhSTATE -> EighthSTATE;
        EighthSTATE [label="Eighth State" URL="\ref EighthSTATE"];
        NinthSTATE [label="Ninth State?" shape="diamond"];
        NinthSTATE -> TenthSTATE [label="Yes" ];
        NinthSTATE -> EighthSTATE [label="No"];
        EighthSTATE -> NinthSTATE;
        TenthSTATE [label="Tenth State" URL="\ref TenthSTATE"];
        EleventhSTATE [label="Eleventh State?" shape="diamond"];
        EleventhSTATE -> ERROR [label="Yes" ];
        EleventhSTATE -> TwelfthSTATE [label="No" ];
        TenthSTATE -> EleventhSTATE;
        TwelfthSTATE [label="Twelfth State" URL="\ref TwelfthSTATE"];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel/CSV file with relatively simple format. 1|2|3|4|10|20|30 | | | |40|50|60
I have converted a relatively simple algorithm that performs a large number of calculations
I have a need to run a relatively large number of virtual machines on
I'm trying to do something relatively simple here. Basically I have a table with
I have an iPhone app that has a relatively simple Flurry configuration installed. I
I'm working on a project were we have number (5 at the moment) of
I have a number of macros written for Visual Studio 2005, but they have
I have a number of tracks recorded by a GPS, which more formally can
I have a number of application settings (in user scope) for my custom grid
i have a number of jsp files under web-inf folder. Inside my web.xml i

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.