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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:05:41+00:00 2026-05-31T22:05:41+00:00

How do I create the following graph with the graphviz c-library: digraph G {

  • 0

How do I create the following graph with the graphviz c-library:

digraph G {
    {rank=same; n1, n2}
    n1 -> n2 -> n3;
}

The following lines are clear:

g = agopen("G", AGFLAG_DIRECTED);
agnode(g, "n1");
agnode(g, "n2");
agnode(g, "n3");
agedge(g, "n1", "n2");
agedge(g, "n2", "n3");

How do I rank n1 and n2?

  • 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-31T22:05:43+00:00Added an answer on May 31, 2026 at 10:05 pm

    I’ve found a solution. The braces gave me the hint.

    {rank=same; n1, n2}
    

    It must be a subgraph. So the following lines will do the trick:

    Agraph_t *sub = agsubg(g, "");
    agsafeset(sub, "rank", "same", "");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create the following type of graph with line, bar and heatmap
I need to create a graph that have the following properties: The X Axis
So currently i have a DFS with the following pseudocode procedure DFS(Graph,source): create a
I have the following data set, which represents nodes in a directed graph. CREATE
I have a graph created with MS Chart like the following picture. As you
I create the following class: class Image(object): def __init__(self, extension, data, urls=None, user_data=None): self._extension
I can create the following and reference it using area[0].states[0] area[0].cities[0] var area =
I want to create the following element: <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> If I use something
I want to create the following T-SQL statement: SELECT SUM (sa.Amount) as 'SumAmount', SUM(sa.Cost)
I'm trying the following: CREATE TABLE Table1 ( RecordNo autonumber, --error here! PersonId varchar(50),

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.