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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:47:54+00:00 2026-06-06T02:47:54+00:00

We are given a graph G(V,E) with N nodes (Numbered from 0 to N-1)

  • 0

We are given a graph G(V,E) with N nodes (Numbered from 0 to N-1) and exactly (N-1) two-way Edges.

Each edge in a graph has a positive cost C(u,v)(Edge weight).

The entire graph is such that there is a unique path between any pair of Nodes.

We are also given a List L of node number,at which bomb are placed.

Our aim is to damage/remove the edge from the graph such ,that after damaging/removing the edges from the graph ,there is no connection among the Bombs —

that is after damaging, there is no path between any two bombs.

The cost of damaging the Edge(u,v) = Edge weight(u,v).

So, we have to damage those edges, such that the total damaging cost is minimum.

Example:

Total Nodes=N=5 
Total Bomb=Size of List L=3

List L={2,4,0}//Thats is at node number 2,4 and 0 bomb is placed...

Total Edges =N-1=4 edges are::

u v Edge-Weight

2 1 8

1 0 5

2 4 5

1 3 4



In this case the answer is ::
Total Damaging cost =(Edge Weight (2,4) + Edge Weight(0,1))
           =5+5=10.

So when we remove the edge connecting node (2,4),
and the edge connecting node (0,1) ,there is no connection left 
between any pair of machines in List {2,4,0};

Note any other,combinations of edges(that  we damaged ) to achieve the
target goal ,needs more than 10 unit cost.  

enter image description here

Constraints::
N(ie. Number of Nodes) <= 100,000
ListSize |L|(ie. Number of Bombs) <= N
1 <=Edge cost(u,v) <= 1000,000

What i had done?

Until now, I had not found any efficient way 🙁 .

Further, as the number of nodes is N, the number of edges is exactly N-1 and the entire graph is such there is a Unique path between any pair of Nodes, I got a conclusion that the graph is a TREE.

I tried to modify the Kruskal algorithm but that didn’t help me either.

Thanks!

  • 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-06T02:47:56+00:00Added an answer on June 6, 2026 at 2:47 am

    This is the Multiway Cut problem in trees. It can be solved in polynomial time by a straightforward dynamic programming. See Chopra and Rao: “On the multiway cut polyhedron“, Networks 21(1):51–89, 1991.

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

Sidebar

Related Questions

Given an undirected graph with n nodes, where each of the nodes has a
Given a directed, connected graph with only positive edge weights, are there faster algorithms
Given an undirected graph in which each node has a Cartesian coordinate in space
Is there an algorithm that will, if given two nodes on a graph, find
Given a n*n-sized multi-headed acyclic graph where each node has at most three children
Given a directed graph, the goal is to combine the node with the nodes
I'm trying to generate valid trees given certain graph edges (which can be considered
I am building graphs. A graph consists of nodes linked each other with links
I have a graph, with X nodes and Y edges. Weighted edges. The point
I'm given a graph which can have more than one arch between 2 nodes.

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.