Can someone please Give some Idea about How can I solve this Problem ?? Please help .
Link :http://www.lightoj.com/volume_showproblem.php?problem=1059
I know that's a MST problem . And I found some point of Placing Airports . My idea is :
- I will run a MST .
- If the MST is able to connect all the Nodes then I Place just One Airport initially. And Then if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " then I will place another Airport there & then Remove the Edge's Cost.
- If the is not able to connect all the Nodes then I Place an Air Port where the Parent of a Node is Equal to the Node itself including if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " then I will place another Airport there & then Remove the Edge's Cost.
Am I Correct ?
If I am not Correct then Please give some Idea where am I doing Mistakes ???
If Correct Then Please Give some suggestion about How Can I do this regarding the Following Points :
i) Do I have to Check all Edges ( If there is Repetition of an Edge Multiple times with Several Cost ) or i just Have to Check (n-1) edges ??
ii) How can I place The Airports if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " & Remove the edges Adjacent to it with Same/ Greater Cost .
Please help..
[ My English is Bad. Sorry for that ]