Vcoderz Community
We create websites that have it all, beauty & brains
Lebanon Web Design & Development - Coddict
 

Go Back   Vcoderz Community > Computer Zone > Computers & Information Technologies

Notices

Computers & Information Technologies « Everything related to computers and internet. »

Reply
 
Share Thread Tools Search this Thread
Old 10-22-2009   #1
Sony
Registered Member
 
Sony's Avatar
 
Last Online: 07-12-2012
Join Date: Jan 2007
Posts: 507
Thanks: 38
Thanked 260 Times in 170 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Default component needed

hello guys i'm targeting this task:
an object A will reach the object B
the algorithm will find the path (link) between them not according to the distance ( it's NOT required to find the shortest path) but according to another criteria...something similar to the criteria that we give to a database to sort the results... something like that...
the programming language is not important to me...

thank you.


__________________
the Hell is empty...all Devils are here...
Sony is offline   Reply With Quote
Old 10-22-2009   #2
Google

 
Google's Avatar
 
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
Default

You mean according to priority?
What are you trying to do exactly. Be more clear and specific.
__________________

Google is offline   Reply With Quote
Old 10-22-2009   #3
Sony
Registered Member
 
Sony's Avatar
 
Last Online: 07-12-2012
Join Date: Jan 2007
Posts: 507
Thanks: 38
Thanked 260 Times in 170 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Default

well take the airplans as example if a user wants to go from airport a to airport b he can go directly...
as direct way:
high cost
less time

as passing By airport C and D
less cost
more time

and so on...

i need a component that does not only find the shortest way (direct way)

the user need to travel with the path that have for example the lowest cost or an average cost, hope that you got the idea
__________________
the Hell is empty...all Devils are here...
Sony is offline   Reply With Quote
Old 10-23-2009   #4
xcoder
Ma ghayro
 
xcoder's Avatar
 
Last Online: 04-19-2018
Join Date: Dec 2005
Posts: 5,592
Thanks: 1,765
Thanked 4,201 Times in 2,361 Posts
Groans: 12
Groaned at 18 Times in 11 Posts
Default

I don't really know if i got what you mean, therefore i created something that is more general and you can manipulate the way you wish. I used PHP to do it, since you didn't want database i had to use Array tree structure. You can add as much elements to the last array in the tree (price...) and it will be displayed in the output =)
Sorry for not doing the input form... i gotta go to bed, i've been awake all night.


http://pastebin.com/f19665baa

Result:
__________________
http://twitter.com/danymoussa
xcoder is offline   Reply With Quote
Old 10-23-2009   #5
hegma
Registered Member
 
hegma's Avatar
 
Last Online: 10-02-2012
Join Date: Mar 2006
Posts: 366
Thanks: 110
Thanked 227 Times in 126 Posts
Groans: 12
Groaned at 14 Times in 8 Posts
Default

sorry for not having the time to mak ethe component but i can tell you how you can send a user from airport C to airport D, it's so simple...

Quote:
$airportC = array(
1 => "Elie",
2 => "Ibrahim",
3 => "Samir",
);

$airportD = array(
1 => "Jean",
2 => "Peter",
3 => "Sony",
);
$user=$airportD[3];

array_push($airportC, $user);
print_r($airportC);exit;
you see? with this simple code sony went from airport D to airport C
I hope this can helps you ..
__________________
Let's paint the world ORANGE
hegma is offline   Reply With Quote
Old 10-23-2009   #6
Sony
Registered Member
 
Sony's Avatar
 
Last Online: 07-12-2012
Join Date: Jan 2007
Posts: 507
Thanks: 38
Thanked 260 Times in 170 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Default

thank you xcoder, hegma and google for your care...i need it similar to what xcoder provided.
i need the system to do the following steps
first get from the user the departure airport A and the arrival airport B
the system will look at all the airports linked to A the results are B C and D
the system will take each possible path
A-B
A-C-B
A-D-B
A-C-D-B
and calculate the distance time and cost for each path
then the user will select to display the results filtered according to his needed criteria maybe he need the cheapest one or maybe the timeless one.
as example:

A-B:
high cost
less time
less distance

A-C-B:
considerable cost
more time
more distance

A-D-B:
Low cost
much more time
more distance

the use of the database is only to save the information, i can code it from scratch but if i could find a similar component available it will be better
__________________
the Hell is empty...all Devils are here...
Sony is offline   Reply With Quote
Old 10-23-2009   #7
xcoder
Ma ghayro
 
xcoder's Avatar
 
Last Online: 04-19-2018
Join Date: Dec 2005
Posts: 5,592
Thanks: 1,765
Thanked 4,201 Times in 2,361 Posts
Groans: 12
Groaned at 18 Times in 11 Posts
Default

Quote:
the use of the database is only to save the information, i can code it from scratch but if i could find a similar component available it will be better
The use of the database is way more than storing data, your system could work way better using a DB, you can group and order to get your results with minimum and maximum....
__________________
http://twitter.com/danymoussa
xcoder is offline   Reply With Quote
Old 10-25-2009   #8
Sony
Registered Member
 
Sony's Avatar
 
Last Online: 07-12-2012
Join Date: Jan 2007
Posts: 507
Thanks: 38
Thanked 260 Times in 170 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Default

Quote:
Originally Posted by xcoder View Post
The use of the database is way more than storing data, your system could work way better using a DB, you can group and order to get your results with minimum and maximum....

i know my friend i know...but the tutor don't want us to let the db do the job hehe he just want it to store the information...
__________________
the Hell is empty...all Devils are here...
Sony is offline   Reply With Quote
Reply

  Vcoderz Community > Computer Zone > Computers & Information Technologies

Tags
component, needed



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump


All times are GMT +1. The time now is 06:17 PM.


Lebanon web design and development
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Share