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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:43:32+00:00 2026-05-20T12:43:32+00:00

I have two arrays, one is a node-node-cost array [a_node,b_node,cost] which has 8000 entries

  • 0

I have two arrays, one is a node-node-cost array [a_node,b_node,cost] which has 8000 entries and the other one is an association of node with coordinates [node,x,y] which has around 8000 entries as well. Is it better to have a static array of these two or is it better to store these in the database and from that create an array as of performance issue?

These two array will be used to run the shortest path algorithm.

  • 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-20T12:43:32+00:00Added an answer on May 20, 2026 at 12:43 pm

    It sounds like you’ll probably want to use a dynamic programming solution where you calculate a small portion of the problem on each iteration and store the intermediate results which will allow you to calculate the shortest path once you are done with all of the intermediate calculations.

    I would suggest storing all of your information in a database and selecting out a subset of records (maybe 100 at a time?). Calculate the intermediate information for each node and store that back to the database. If you are going to reuse this path information thousands or millions of times, you don’t want to be recalculating it constantly. You’ll only want to recalculate when the graph changes.

    My preferred shortest path algorithm is http://en.wikipedia.org/wiki/Dijkstra‘s_algorithm and it lends itself to an efficient dynamic programming solution.

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

Sidebar

Related Questions

I have two arrays the first one has this structure Parameter Keys array array
I have two arrays, one is very large (more than million entries) and other
Say I have two arrays where one is a permutation of the other: A
I have two different arrays. One array, a, for a list of people. My
I have two arrays. One is $categories which contains all categories retrieved from my
I have two arrays. One for input boxes and other for checkbox. inputbox[] checkbox[]
I have two arrays. One contains id=>count and the other contains id=>name . I'm
I have two arrays: one for article names, and the other for url links
I have two arrays, one with search terms and another which is multiple lines
I have two arrays built from an XML response to an api. One array

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.