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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:15:30+00:00 2026-06-04T05:15:30+00:00

Say I have the edges A -> C A -> D A -> E

  • 0

Say I have the edges

A -> C
A -> D
A -> E
B -> D
B -> E

To maximise data locality I’d arrange for the DAG to be stored in this order in memory (as an array) to minimise the distance between the node and it’s dependencies.

C, A, D, E, B

so that A has a distance 1 to C, 1 to D, 2 to E.

And that B has a distance of 1 to E, and 2 to D.

Is there name for an algorithm that does this? If not, how would one implement this?

  • 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-04T05:15:32+00:00Added an answer on June 4, 2026 at 5:15 am

    Looks like you want to linearize the DAG. I don’t know whether you are using it for dependancy resolution. Topological_sorting looks familiar to your question. also the program tsort does very similer thing.

    However it is dependancy linearization.

    neel@gentoo:~$ tsort
    C A
    D A
    E A
    D B
    E B
    
    C
    D
    E
    B
    A
    

    Which prints the order in which that tasks have to be performed. and it will possible not work if there is a cycle. its relevant as you mentioned its acyclic.

    I dont know if there is any such algorithm for data locality ordering string or anything similar however It looks like your data locality string have some problem.

    What if C is close(1) to A and is also close(1) to B and B is too far(4) from A how will you represent it with your data locality string ?

    I don’t now what exactly you want to do. If you want to liniarize dependency to perform tasks in proper order then do a topological sort.

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

Sidebar

Related Questions

Say I have this example graph, i want to find the edges connected to
Lets say have this immutable record type: public class Record { public Record(int x,
say i have a nvarchar field in my database that looks like this 1,
How can I have a listener on the edges of the layout. Lets say
So let's say i have one div and one image like this <div id=image_wrapper>
Say I have a list of edges each containing two nodes (to and from).
I have a PNG in a UIImageView with alpha around the edges (let's say
Lets say I have some markup like this: <html> <head> <style type=text/css> #container {
Say I have a type edge: struct edge { long long weight; int dest;
Say I have a couple of basic objects like so: [Serializable] public class Base

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.