|
|
back to boardhow sample #1 is 3.9093 ? Please, someone explain? my algo gives correct in sample 2 but produces 4.0000 in 1st sample? what's going on? i first determine convex hull of given 4 points. then i determine fermat point for each triad and check distance. then choose any one point and check dist to other 3. then i try connect 4 points through edges and finally if the convex hull has 4 points then i find 2 steiner points by forming equilateral triangles on opposite edges and by connecting them and to 4 points i minimize output. but, in first sample when connecting (2,0) to other 3 points the dist 4.0000 becomes optimal and all steiner point pairs give more than 4. i note, here 3 points are co-linear. does there exist special algo for such tests? what am i missing. please, help me. here is my code which i plan to remove after getting some help. many many thanks in advance. [AC] [Code Deleted] Edited by author 08.11.2011 21:33 Re: how sample #1 is 3.9093 ? Please, someone explain? i was wrong. after taking mst of several points got AC |
|
|