[Competition] Function Challenge #3

Page 1 of 1

2 Replies - 8074 Views - Last Post: 24 January 2011 - 02:46 PM

#1 Dogstopper

Reputation: 2920
• Posts: 11,195
• Joined: 15-July 08

[Competition] Function Challenge #3

Posted 18 January 2011 - 11:44 AM

This week's challenge can have many ways to do it. However, the purpose is to explore Graph theory. Give it a shot to see what you can do.

You run a post office and you have a certain number of destinations that you need to deliver to. However, each one has a certain cost associated with it. For example, if stop A and stop B are close by, it is better to go by A, then B rather than going to A, back to the post office and then to B. See if you can find the optimal route for a list of several delivery locations.

For a tougher challenge, create a list of destinations on a route not just for one truck, but optimize the algorithm to handle any number of trucks and find the fastest/most efficient route for a bunch of delivery trucks.

Is This A Good Question/Topic? 1

Replies To: [Competition] Function Challenge #3

#2 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11241
• Posts: 42,295
• Joined: 27-December 08

Re: [Competition] Function Challenge #3

Posted 18 January 2011 - 11:02 PM

My solution using Dijkstra's algorithm:
Spoiler

#3 moobler

Reputation: 143
• Posts: 224
• Joined: 21-January 11

Re: [Competition] Function Challenge #3

Posted 24 January 2011 - 02:46 PM

This is the first challenge I'm posting to, so I don't really know the protocol...so the description's going in spoiler tags and my JAR (including the ugly, mostly uncommented source) is here: FunctionChallenge3.jar.

Spoiler