Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A PHP Puzzle Script !!!
Old 06-08-2008, 02:20 AM A PHP Puzzle Script !!!
Novice Talker

Posts: 7
Name: Nitin
Location: INDIA
Trades: 0
Hi All ...

I have some problems in a Script, here is details:

1. I have to save Distance between 2 cities in the DataBase .

2. Now, I have to develop a PHP Script which will Find Route between 2 Cities.
There can be 'N' Numbers of routes.

I don't know how to solve this. This is looking like a Tree search or ...

Please Help ....

Regards,
Nitin
nitin44u is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2008, 05:51 AM Re: A PHP Puzzle Script !!!
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
I have a feeling php is not the best way of doing this, (easily at least). A language like perl or python would be better.

I think the best way of doing this, is find the route between cities then to get to slightly further away ones just link up the routes between the cities. Though, I would suggest just using the google maps API.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 06-08-2008, 08:49 AM Re: A PHP Puzzle Script !!!
Novice Talker

Posts: 7
Name: Nitin
Location: INDIA
Trades: 0
Hi,

I want to code a General Code & don't want to use Google API.

I have one more idea:

Can i maintain a Routing table in database ?


Regards,
nitin44u is offline
Reply With Quote
View Public Profile
 
Old 06-08-2008, 02:04 PM Re: A PHP Puzzle Script !!!
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
This sounds a little homeworky to me, and yeah you can maintain a routing database, the question is, what type of routes do you have?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-08-2008, 11:22 PM Re: A PHP Puzzle Script !!!
Novice Talker

Posts: 7
Name: Nitin
Location: INDIA
Trades: 0
hi,

1. i have many cities. i know the distance between each 2 connected cities
2. Now problem is, By using the above distances, I have to Find a Route beween any
2 Random cities. There can be more than 1 routes.

e.g.
A - B 20km
A - C 20 KM
B - C 15 KM
B - D 10 KM
C - E 20 KM
..... so on

Now, we have to find all possible route between 2 cities..

regards,
nitin44u is offline
Reply With Quote
View Public Profile
 
Old 06-10-2008, 03:05 PM Re: A PHP Puzzle Script !!!
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
What I meant is are the routes "Take Main street for 5 KM then turn left onto Second Street. Take Second Street for 10 KM and you'll be at your destination" or are they "City A connects to cities B and C
AB is 15 KM
AC is 12 KM
City B connects to A, C, and D
BA is 15 KM
BC is 2 KM
BD is 20 KM
City C connects to A and B
CA is 12 KM
CB is 2 KM
City D connects to B
DB is 20 KM"
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to A PHP Puzzle Script !!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38783 seconds with 12 queries