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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:15:44+00:00 2026-06-17T06:15:44+00:00

There’s 2d array, with points marked on it – just like in the first

  • 0

There’s 2d array, with points marked on it – just like in the first picture. What I have to do, is to find connection between all the points on that map (so you can travel from any point to all other points). Sum of length of all edges has to be possibly smallest.

enter image description here

Input:

(0, 0) (5, 5) (5, 1) (4, 4) (1, 5) (2, 4) (2, 1) // 1st,2nd,3rd city ...

Output:

1-7, 7-3, 7-6, 6-5, 6-4, 4-2
  • 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-17T06:15:45+00:00Added an answer on June 17, 2026 at 6:15 am

    Treat your input set of points as a fully connected graph, with the distance between a pair of points as the edge weight. Then find the minimum spanning tree of the graph.

    Kruskal’s algorithm is particularly easy:

    • Start with no edges in your output graph.
    • Go through each edge of your input graph in order of weight, smallest first.
      • If the two vertices aren’t already part of the same tree in your output graph, then add the edge to your output graph.

    There are various techniques you can use to make this very fast if speed is an issue.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
There are two kinds equals methods? public boolean equals(Bigram b) { return b.first ==
There's a bright pixel row (some kind of reflection or so) through all items
There's a map with points: The green number next to each point is that
There is a variable, suppose item . It is an array holding two values
There are two vectors std :: vector and QVector . We have to check
I have an array which has BIG numbers and small numbers in it. I
There are plenty of questions and answers to this like this question but I
There's a webpage with something annoying on it which I'd like to hide every
There is a properly formatted text in Html textarea which looks like : As

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.