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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:29:44+00:00 2026-06-17T11:29:44+00:00

I am visualizing a collection of process with GraphViz. Each process consists of some

  • 0

I am visualizing a collection of process with GraphViz. Each process consists of some Read or Write operations in program order. Naturally, it is desirable to arrange the operations in the left-to-right order with respect to each process.

Using GraphViz (version 2.28), my code goes like this:

digraph G 
{
ranksep = 1.0; size = "10,10";
{ 
    node [shape = plaintext, fontsize = 20];
    0 -> 1 -> 2 -> 3 -> 4;
}
node [shape = box];
{rank = same;0;wy1;rf1;rc1;rz1;ry1;ra1;rb1;rx2;}
{rank = same;1;wf1;}
{rank = same;2;wx2;wc1;}
{rank = same;3;wf2;wz2;wx3;wa1;}
{rank = same;4;wz1;wy2;wx5;wb1;}
wy1 -> rf1;
rf1 -> rc1;
rc1 -> rz1;
rz1 -> ry1;
ry1 -> ra1;
ra1 -> rb1;
rb1 -> rx2;
wx2 -> wc1;
wf2 -> wz2;
wz2 -> wx3;
wx3 -> wa1;
wz1 -> wy2;
wy2 -> wx5;
wx5 -> wb1;
wf1 -> rf1[color = blue];
wc1 -> rc1[color = blue];
wz1 -> rz1[color = blue];
wy1 -> ry1[color = blue];
wa1 -> ra1[color = blue];
wb1 -> rb1[color = blue];
wx2 -> rx2[color = blue];

// W'WR Order:
wx3 -> wx2[style = dashed, color = red];

// W'WR Order:
wx5 -> wx2[style = dashed, color = red];
}

I am sorry to say that I am not allowed to post the output picture with too low reputation. If you can run the code, you will see that the result is not so satisfying due to the out of order in process with pid = 3. Specifically, GraphViz layout algorithm has rearranged the (ideal) order "wf2-> wz2 -> wa1 -> wx3" to "wx3, wf2, wz2, wa1". Therefore, my problem is:

My Problem: How to enforce the left-to-right node ordering in the rank environment?

With exploring in this site, I have found some similar problems and potential solutions. However, they just did not work in my specific example:

  • Graphviz .dot node ordering: the constraint = false option made my PDF picture worse. I checked the dot User’s Manual which says:

    During rank assignment, the head node of an edge is constrained to be on a higher rank than the tail node. If the edge has constraint=false, however, this requirement is not enforced.

    Based on the above statements, (I guess) constraint = false option takes effect between different ranks instead of in the same rank.

  • Graphviz—random node order and edges going through labels: With surprise, the constraint = false option helped the "finite state machine" a lot in the same rank. Again, it does not save me from the trouble.

  • graphviz: circular layout while preserving node order: The process graph is dynamic both in number of nodes and edges. So, it maybe not attractive to use the absolute position for nodes (to cause many edge crossing?).

    Thanks for any suggestions. And executable code will be appreciated very much.

dot file

  • 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-06-17T11:29:44+00:00Added an answer on June 17, 2026 at 11:29 am
        digraph G 
    {
    ranksep = 1.0; size = "10,10";
    { 
        node [shape = plaintext, fontsize = 20];
        0 -> 1 -> 2 -> 3 -> 4;
    }
    node [shape = box];
    {
    rank = same;
    0->wy1->rf1->rc1->rz1->ry1->ra1->rb1->rx2 [color=white];
    rankdir=LR;
    }
    {
    rank = same;
    1->wf1[color=white];
    rankdir=LR
    }
    {
    rank = same;
    2->wx2->wc1[color=white];
    rankdir=LR;
    }
    {
    rank = same;
    3->wf2->wz2->wx3->wa1[color=white];
    rankdir=LR;
    }
    {
    rank = same;
    4->wz1->wy2->wx5->wb1[color=white];
    rankdir=LR;
    }
    wy1 -> rf1;
    rf1 -> rc1;
    rc1 -> rz1;
    rz1 -> ry1;
    ry1 -> ra1;
    ra1 -> rb1;
    rb1 -> rx2;
    wx2 -> wc1;
    wf2 -> wz2;
    wz2 -> wx3;
    wx3 -> wa1;
    wz1 -> wy2;
    wy2 -> wx5;
    wx5 -> wb1;
    wf1 -> rf1[color = blue];
    wc1 -> rc1[color = blue];
    wz1 -> rz1[color = blue];
    wy1 -> ry1[color = blue];
    wa1 -> ra1[color = blue];
    wb1 -> rb1[color = blue];
    wx2 -> rx2[color = blue];
    
    // W'WR Order:
    wx3 -> wx2[style = dashed, color = red];
    
    // W'WR Order:
    wx5 -> wx2[style = dashed, color = red];
    }
    

    I am not quite sure that i’ve correctly got your problem, but try using this and comment please if it is what you want. I’ve added invisible edges for correct ranking of nodes and used rankdir to use left-right layout.

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

Sidebar

Related Questions

I have a project for visualizing some data on tablet. I'll probably use android
(Using SQL Server 2008) I need some help visualizing a solution. Let's say I
I'm new to OAuth and having trouble visualizing the process behind how it works.
I am visualizing an incremental algorithm and at each step in the algorithm I
I'm working on a tool for visualizing objects in Java. This tool provides some
This function generates simple .dot files for visualizing automata transition functions using Graphviz. It's
Recently I wrote myself an Ear Clipping Triangulator as personal research. After visualizing some
I am working on a project for visualizing large specialized datasets. A Project consists
I'm in the process of visualizing a linked list. Just doing it for fun
I'm working on visualizing a matrix in R (almost exactly like http://reference.wolfram.com/mathematica/ref/MatrixPlot.html ), and

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.