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

  • Home
  • SEARCH
  • 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 7711739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:27:10+00:00 2026-06-01T01:27:10+00:00

I want to represent a DAG as JSON text and wondering if anyone has

  • 0

I want to represent a DAG as JSON text and wondering if anyone has tried this and any issues they dealt with in regards to validating if the JSON is actually a DAG.

  • 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-01T01:27:11+00:00Added an answer on June 1, 2026 at 1:27 am

    Label each node and make an edge list. That is, each node stores the nodes that it has edges to, for example:

    {
      "a": [ "b", "c", "d" ],
      "b": [ "d" ],
      "c": [ "d" ],
      "d": [ ]
    }   
    

    You can store many kinds of graphs this way, not just DAGs, so you will need to post-process it to ensure that it has no loops.

    Pick a node, DFS, if you see any node more than once it is not a DAG. Then remove all of the nodes you just saw and repeat with any remaining nodes. Do this until you find a loop or you’ve removed all of the nodes, in the latter case the graph is a DAG.

    Note that this does not store parent nodes since that is redundant information. You can generate those after loading the graph if you need that data.

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

Sidebar

Related Questions

I want to represent tabular data in json file. I want to read this
I want to represent height in this format in javascript 6'00 I tried this
I want to represent multiple conditions like this: if [ ( $g -eq 1
I've got a sparse array that I want to represent in JSON. For example:
I want to represent midnight by java.util.Date class. To check this I output this
I want to represent this type of modeling with Spring Data Neo4j: Object ------Value------>
I have a complex JSON object that I want represent as C# class. I
Let's say I want to represent \q (or any other particular backslash-escaped character). That
I want to represent threaded comments in Java. This would look similar to the
We have objects that we want to represent in stacks (think of stacking items

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.