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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:45:42+00:00 2026-05-25T21:45:42+00:00

I have Graph with N nodes and edges with cost. (graph may be Complete

  • 0

I have Graph with N nodes and edges with cost. (graph may be Complete but also can contain zero edges).

I want to find K trees in the graph (K < N) to ensure every node is visited and cost is the lowest possible.

Any recommendations what the best approach could be?

I tried to modify the problem to finding just single minimal spanning tree, but didn’t succeeded.
Thank you for any hint!

EDIT

little detail, which can be significant. To cost is not related to crossing the edge. The cost is the price to BUILD such edge. Once edge is built, you can traverse it forward and backwards with no cost. The problem is not to “ride along all nodes”, the problem is about “creating a net among all nodes”. I am sorry for previous explanation

The story
Here is the story i have heard and trying to solve.

There is a city, without connection to electricity. Electrical company is able to connect just K houses with electricity. The other houses can be connected by dropping cables from already connected houses. But dropping this cable cost something. The goal is to choose which K houses will be connected directly to power plant and which houses will be connected with separate cables to ensure minimal cable cost and all houses coverage 🙂

  • 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-25T21:45:43+00:00Added an answer on May 25, 2026 at 9:45 pm

    I just came up with the easy solution as follows:

    N – node count

    C – direct connections to the grid

    E – available edges


    1, Sort all edges by cost

    2, Repeat (N-C) times:

    1. Take the cheapest edge available
    2. Check if adding this edge will not caused circles in already added edge
    3. If not, add this edge

    3, That is all… You will end up with C disjoint sets of edges, connect every set to the grid

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

Sidebar

Related Questions

Suppose I have a graph composed of nodes and edges, and I want to
I have a class Graph with two lists types namely nodes and edges I
I have about 70k nodes, and 250k edges, and the graph isn't necessarily connected.
I have a graph, with X nodes and Y edges. Weighted edges. The point
I have a networkx graph. I am adding nodes by adding edges G.add_edge(route[i-1],route[i]); Now
To simplify the problem, I have a graph that contains nodes and edges which
I have next code that represents graph edges and nodes (simplified for question): public
I have a graph I've created in graphviz, but the problem is that edges
I have coded a program which dynamically inserts nodes and edges, overlaying the graph
I have a weighted graph with its nodes and edges. Each node contains a

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.