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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:52:06+00:00 2026-06-01T06:52:06+00:00

My project is to implement minimum spanning tree using java. I aim to use

  • 0

My project is to implement minimum spanning tree using java. I aim to use Prim’s algorithm to do the task.

The definition of the graph is G = (V, E) where V is the set of pins, E is the set of possible interconnections between pairs of pins, and for each edge (u,v) in E we have a weigh w(u,v) specifying the cost to connect u and v.

My idea is to use two hashmaps. First would have pin as a key and a list of neighbours as value. The second hashmap would take list of edge (u,v) as a key and the value would be its weight.

What do you think is the best way to store the graph?

  • 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-01T06:52:07+00:00Added an answer on June 1, 2026 at 6:52 am

    Graphs are generally (without regard to the algorithm used with those graphs) stored as either :

    • adjacency lists,
    • adjacency matrices,
    • incidence lists,
    • incidence matrices.

    All have their advantages and disadvantages concerning memory usage and time required to traverse them. Wikipedia has a great write-up on graph representations in computers.

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

Sidebar

Related Questions

My project is a computer vision java application which should implement the following :
I had implement the project that have to use QR Reader via Zxing Project.
I want to implement my project using interface oriented programming. Since Python itself does
Good Morning, Im using the Google Maps V3 to implement a project. In my
Im trying to implement small project where people can set tags for certain items
ASP.NET MVC3 Razor project Trying to implement OpenID using http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx I've edited the openid-en.js
Currently we have a project to implement an Internet Banking site, and we are
I am working a school project to implement a Huffman code on text. The
I am working on a project to implement digital signatures of outgoing messages and
I have BaseView which implement UIViewController. Every view in project must implement this BaseView.

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.