# [Competition] Function Challenge #3

Page 1 of 1

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

### #1 Dogstopper

• The Ninjaducky

Reputation: 2950
• Posts: 11,217
• 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: 11449
• Posts: 43,165
• Joined: 27-December 08

## Re: [Competition] Function Challenge #3

Posted 18 January 2011 - 11:02 PM

My solution using Dijkstra's algorithm:
Spoiler

Was This Post Helpful? 1

### #3 moobler

• D.I.C Head

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

Was This Post Helpful? 1

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }