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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:38:10+00:00 2026-05-31T07:38:10+00:00

In both space and operation cost which is the best way to implement a

  • 0

In both space and operation cost which is the best way to implement a multigraph that has more edges than vertices?

In the worst case it would have 5000 edges and 1000 vertices. I was thinking of an adjacency list because it has a great time for most of the operations like add edges, check adjacency between edges, add vertices (almost all the time), etc…. but it still consumes a space of |v^2|.

Am I on the right track? Is there a better implementation? Any tips on the best way to implement the the adjacency list?

  • 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-31T07:38:11+00:00Added an answer on May 31, 2026 at 7:38 am

    A ratio E/V = 5 means really really sparse graphs, which is a plus for lists. In general adjacency lists are overall better than adjacency matrices.

    Now the cost of insertion is O(degree(vertex)) but with so few edges it will be negligible.
    Don’t look further, use adjacency lists.

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

Sidebar

Related Questions

Both quicksort and heapsort do in-place sorting. Which is better? What are the applications
both abstract and virtual are going to be override in child class than whats
What's the best way of partitioning a class when its functionality needs to be
I have two UITableViews and both show a space of about 30 px between
I've a 'C' program which has encountered a strange problem.. I'm getting segmentation fault
What's the best (halting) algorithm for determining if a linked list has a cycle
Is there any way to compare two functions in Haskell? My thought is that
Turing machines can consider complexity in both space (memory space on tapes) and time.
To toggle node with both mouseclick and space I just wrote : .bind(select_node.jstree, function
EDIT: I edited both the question and its title to be more precise. Considering

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.