There is but it's hard to think of an efficient algorithm to solve a problem we don't understand. If we accept that the only use of minecarts (And related lifts, etc.) is to move things from one or two specific locations or stockpiles, to a few other specific locations, and we think manual control is tolerable, then that sets some fairly easy limits on what the algorithm is actually expected to cope with. In this case we don't really have to change the algorithm at all, we just have a minecart that create store jobs like a stockpile.
Well, if we don't understand it, it's time to think about it more until we do.
There shouldn't be any more manual control than absolutely necessary.
OK, let's think logically about how a minecart should probably operate... Unless you want to have the carts pushed around manually waiting at one point or another, then what we need to do is have a way for dwarves to know when it is fine to use a cart as a stockpile, and what areas that cart has connections to when you want to use it as a bulk transport.
Without having to make your dwarves do a really complicated pathfinding check to see when it is acceptable to try to use a minecart, the only thing I can think of is to make a minecart track create its own zone upon creation. Presumably, this will be connected to every other piece of track, lest it be useless, so it basically forms a long, snaking zone throughout the areas you have built those tracks, connecting everything together.
This minecart zone would spread some arbitrary (possibly player-togglable) number of tiles out from the tracks, and when a dwarf tries to take up a job involving hauling, it will check to see if the item to be hauled is within the zone of the tracks, and if the destination is within the zone of the tracks. Pathfinding along tracks, barring some really kooky behavior on the part of the player, should be very easy, so you could probably do a count of how many tiles it takes to get from start to finish fairly fast, but you could have either a pathfinding check to see what a straight walk would be, anyway, to see how many more tiles one would have to travel by foot, and compare that against the minecart's pathing if you want to be really accurate and save as much dwarf travel time as possible. (Again, this is a matter of CPU efficiency vs. Dwarf motion efficiency.) This would have to include the time/tiles it takes a cart-hauling dwarf to actually move the cart into position.
Before using a minecart even makes sense, however, you need to have a set number of items in the area to even make it more useful than just hauling everything by hand.
This is a possible calculation, of course, it's just a very wierd one, since it means that you have to get the dwarf to calculate how many trips it would take the dwarf back and forth without using the cart vs. how many trips it takes with a cart, plus the amount of time you have to spend getting the cart into position, plus the amount of time it takes to get the dwarf to the cart to start pushing it... and these might have to be done by quick-and-dirty calculations to save on pathfinding time, and prevent a dwarf from just sitting there and making a dozen pathfinding calculations and then winding up just doing the simple pick up the earrings all by himself since it was only very light items type of solution.
The player might have some sort of ability to interfere with how the zones are set up - letting the player exclude some areas from being in zones, and include larger areas than the cart would normally allow to be in zones, if need be. It might just be a separate part of the zones menu, or some special cart extension of the zones menu.
Cart zone tiles would theoretically also be able to include areas that are still walls as part of the zones, so that the yet-to-be mined portions of the mines would already be included in the cart zone... but that causes problems because you don't want zones that are on other sides of walls to be included. The other solution is to make any tile that is made into a floor with no blocking wall tile take another check when the pathfinding connectivity map is running to see if any adjacent tile is already in a minecart zone, and if so, check for cart tracks within a finite number of steps (flood style) to see if it should be connected to the minecart zone. This would mean that a tile that was recently mined would declare itself part of a minecart zone, and then tell the stone hauling job of the stone the wall became to become a potential minecart hauling job if its destination is part of the minecart zone's sphere of influence, as well.
... OK, that's all that a first-blush look at how to make a minecart path will tell me... so could someone blow this idea up for me so I can try to think of a better way to rebuild it?
Gah.. so many people posting in this thread... 7 replies... I need to stop reading books in the middle of posts.