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 1004. Sightseeing Trip

A good algorithm
Posted by Le Phuoc Hai Son 11 Jun 2001 15:03
Any one here know a good algorithm to find the shortest
loop in a graph?
Re: A good algorithm
Posted by Dinh Quang Hiep (mg9h@yahoo.com) 11 Jun 2001 23:12
kheo thi N^3, con khong thi khoang N^4 !

Tong Hop Vo Dich @

QH@
ENGLISH, please. (Was: A good algorithm)
Posted by Stefan Pochmann 12 Jun 2001 05:18
Don't you understand, what "Write in English, please."
means? Even if you knew him personally, it would be
more friendly to the rest of us if you followed this
advice. It's kind of annoying not to understand people
talk.

Best regards,
Stefan Pochmann
Re: A good algorithm
Posted by HNT 12 Jun 2001 08:37
Mmmm, I think that you shouldn't know it ( N^3 Dynamic
Programming)
> Any one here know a good algorithm to find the shortest
> loop in a graph?
Re: A good algorithm
Posted by Le Phuoc Hai Son 12 Jun 2001 11:24
u CO THE NOI RO VE THUAT TOAN O.
TUI CHI NGHI RA 2 CACH:
-DUNG LOANG CHI TUNG CAP DINH
-DUNG LOANG DE TIM CHU TRINH
tUI KHONG BIET CACH THU 2 CO DUNG O?
Re: A good algorithm
Posted by Le Phuoc Hai Son 12 Jun 2001 11:27
wHY DON'T YOU EXPLAIN THAT ALGORITHM.
iN VIETNAMESE IT'S "QUY HOACH DONG"???
Re: ENGLISH, please. (Was: A good algorithm) <= sometime i wanna use my mother languague, ok ;) ?
Posted by Dinh Quang Hiep (mg9h@yahoo.com) 12 Jun 2001 19:31
> Don't you understand, what "Write in English, please."
> means? Even if you knew him personally, it would be
> more friendly to the rest of us if you followed this
> advice. It's kind of annoying not to understand people
> talk.
>
> Best regards,
> Stefan Pochmann
Re: A good algorithm <= this one, is not "KHEO" (O(N^4))
Posted by Dinh Quang Hiep (mg9h@yahoo.com) 12 Jun 2001 20:18
choose one node for the first city i, the "remove" it from
the list, now, you find the shortest path between each pairs
of the remaining nodes, (using floyd algorithm with O(N^3))
for each d(u, v) (u <> v), compare the sum A[i][u] + d[u][v]
+ A[v][i] with the best root

There's some tricky that, with each route, you can "convert"
it the another route, which is better for programming,
satisfy that the first city is the lowest number => when try
to find the shortest way like the algorithm above, u and v
always > i !

Good luck !

QH@
Re: A good algorithm <= this one, is not
Posted by Pete Lupherenko 21 Oct 2001 15:08
> choose one node for the first city i, the "remove" it
from
> the list, now, you find the shortest path between each
pairs
> of the remaining nodes, (using floyd algorithm with O
(N^3))
> for each d(u, v) (u <> v), compare the sum A[i][u] + d[u]
[v]
> + A[v][i] with the best root
>
> There's some tricky that, with each route, you
can "convert"
> it the another route, which is better for programming,
> satisfy that the first city is the lowest number => when
try
> to find the shortest way like the algorithm above, u and
v
> always > i !
>
> Good luck !
>
> QH@
But why  O (N^3) ????
 Floyd's algorithm ( O(N^3)  ) will be used several
( O(N) ) times!