ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1143. Electric Path

Isn't this problem NP-complete ?
Posted by Alyosha Popovich 6 May 2002 11:42
Yes it is, just try a simple heuristhic and brute forze when size <=10
Posted by Miguel Angel 10 May 2002 00:18
>
10x a lot :)
Posted by Alyosha Popovich 12 May 2002 23:49
> >
DP solution for convex polygon... I think
Posted by Christopher Moh 14 Jun 2002 23:56
My accepted solution is DP (for all cases, no brute force search).

The basic idea is that because all possible edges satisfy the
triangle inequality, the optimal hamiltonian path cannot cross
itself.  Hence, because of the fact that all the vertices lie on a
convex polygon, there is an implicit ordering of the points (what it
is, I'll let you think) - lending itself to a tabular method (DP).
Re: DP solution for convex polygon... I think
Posted by XueMao 22 Mar 2003 16:32
I am sorry but I can hardly agree with you . this problem is
obviously hamiltonian circuit . And it was proved to be a NP
problem.so DP can not solve it .