need c++ implementation of the algorithm

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2009
Posts: 3
Reputation: san26 has a little shameless behaviour in the past 
Solved Threads: 0
san26 san26 is offline Offline
Newbie Poster

need c++ implementation of the algorithm

 
0
  #1
Jun 29th, 2009
can anybody help me on this algo provided below....................
I need a c++ implementation for the following algorithm.............
Algorithm RST-T
Input: A set of points P = {(xi, yi)}
Output: A rectilinear Steiner tree with all points in P connected
A. Build an RST-T with horizontal trunk
1. Set ymid = median of all yi
2. Set xmin = Min{xi|(xi,ymid)∈P}, xmax = Max{xi|(xi,ymid)∈P}
3. Construct a horizontal trunk from (xmin,ymid) to (xmax, ymid)
4. Set U = {(x,y)|(x,y)∈P and y > ymid}
L = {(x,y)|(x,y)∈P and y <ymid}
5. Sort all points in U according to their x coordinate by
descending order
6. Set Pini=(x,y),where (x,y)∈U and (x,y) minimize |x-xmin|+|x- xmax|
7. Connect Pini to the trunk, going vertical direction first
8. For all the points in U and to the left of Pini, from right to left,
process point p one by one:
Connect p to the neighboring stem or to the trunk depending on
which way is shorter, when we connecting a point to trunk or
stem, we always go vertical direction first.
9. For all the points in U and to the right of Pini, from left to right,
process point p one by one:
Connect p to the neighboring stem or to the trunk depending on
which way is shorter, when we connecting a point to trunk or
stem, we always go vertical direction first.
10. Repeat the procedure from step 5 to step 9, process points in L
B. Build an RST-T with vertical trunk in the similar way to A.
C. Return one tree with shorter total wirelength from two trees built
by step A and step B.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: need c++ implementation of the algorithm

 
1
  #2
Jun 29th, 2009
http://www.daniweb.com/forums/announcement8-2.html
And we need you to make an effort to solve your own homework, which is more than just cross-posting
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 3
Reputation: san26 has a little shameless behaviour in the past 
Solved Threads: 0
san26 san26 is offline Offline
Newbie Poster

Re: need c++ implementation of the algorithm

 
0
  #3
Jun 29th, 2009
i have developed coding upto step 5 btt after that i am getting confused..............so plz help and if u want to see my work i can post here...............
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 476
Reputation: csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice 
Solved Threads: 76
csurfer's Avatar
csurfer csurfer is offline Offline
Posting Pro in Training

Re: need c++ implementation of the algorithm

 
0
  #4
Jun 29th, 2009
Wow such a nice problem to solve !!! I solved it now you too try !!!
I Surf in "C"....
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,842
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: need c++ implementation of the algorithm

 
0
  #5
Jun 29th, 2009
Originally Posted by san26 View Post
i have developed coding upto step 5 btt after that i am getting confused..............so plz help and if u want to see my work i can post here...............
Yeah, post the work here and a specific question. And mark the other thread solved.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 3
Reputation: san26 has a little shameless behaviour in the past 
Solved Threads: 0
san26 san26 is offline Offline
Newbie Poster

Re: need c++ implementation of the algorithm

 
0
  #6
Jun 29th, 2009
i am attaching two documents ..............now my problem arises from step 6 onwards.how pini is calculated and what the logic behind it and onwards........that means step7,8.............so plz help.............
Attached Files
File Type: cpp STST.CPP (4.1 KB, 4 views)
File Type: h STST.H (239 Bytes, 1 views)
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,978
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 308
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: need c++ implementation of the algorithm

 
0
  #7
Jun 29th, 2009
Post your code using codetags instead of attaching it as files.

Also read this.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 320 | Replies: 6
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC