1 2 Previous Next 17 Replies Latest reply on Aug 27, 2014 9:45 AM by jormond

# Shortest path with dijkstra algorithm

Does any body sucessfully integrated dijkstra algorithm to find shortest path?

any comment, help or resources shall be appreciated.

• ###### 1. Re: Shortest path with dijkstra algorithm

I had to look up Wikipedia to find out what dijkstra's algorithm is, but based on that this sounds like a case for a recursive custom function, or perhaps a recursive script. I'm sure that is no help whatever, just my comment. All the best!

• ###### 2. Re: Shortest path with dijkstra algorithm

It can be done in ScriptMaster (groovy/java implementation).

• ###### 3. Re: Shortest path with dijkstra algorithm

shortest path for what? (map routing?)

• ###### 4. Re: Shortest path with dijkstra algorithm

It seems there are javascript implementations, so you can do it in Webviewer.

• ###### 6. Re: Shortest path with dijkstra algorithm

great information!  I'll try to learn how to use ScriptMaster for my needs!

• ###### 7. Re: Shortest path with dijkstra algorithm

Hi!  my main focus is to implement dijkstra algorithm to find shortest path between port to port in the ocean.

Any idea, comments or help for me?  Thanks

• ###### 8. Re: Shortest path with dijkstra algorithm

itsbrian wrote:

Any idea, comments or help for me?  Thanks

I don't understand your repeating the question.

The algorithm is known, so “implementing” it means either writing a function or a script, which should be perfectly feasible with native FileMaker tools alone – or look for an existing solution that you can implement, e.g. as a JavaScript script in a Web Viewer.

• ###### 9. Re: Shortest path with dijkstra algorithm

Because I'm a beginner in the field of complex scripting and JavaScript...

FileMaker is an excellent tool to implement business logic and I've already made severl of those, 5-year forecasting, risk management and project feasibility etc., of which main calculations are within +,-,*,/ and some financial functions.   Algorithm, javascritp and complex FileMaker script, however, are all looks like non-understandable machine language to me....

• ###### 10. Re: Shortest path with dijkstra algorithm

itsbrian, I looked at the definition of the dijkstra algorithm and from what I can tell. there needs to be multiple paths and "costs" for the different routes. It seemed that the costs could be almost anything. (time, distance, port costs, ...)  Not know anything about shipping, you mentioned port to port, that seems to me only two points with only one route. What are the options between the two ports?

• ###### 11. Re: Shortest path with dijkstra algorithm

The solution I wish to develope is for ocean shipping companies.

voyage duration, distance in nautical miles and fuel cost is important for them. And the two ports mean harbour for ship arrive and departure.

Geocoding is also an important with this because ships can only propell through the ocean, she can not cross over land or islands.

Not in expert in algorithm and complex scripting, thus it is quite challenging to me.

• ###### 12. Re: Shortest path with dijkstra algorithm

If there is a webservice or something with an API, you may be able send it to that and return the shortest route.  Some of the JavaScript options may be the best bet. Supply the 2 port locations to a webviewer that points to the JavaScript and have it return the shortest route. Grab that, and insert into a field in FM.

Matt Petrowski just covered the idea of using the Webviewer and JavaScript in a video on his site. It's not specifically about mapping, but about using JavaScript and the Webviewer. https://www.filemakermagazine.com/videos/sorting-data-super-fast

Another option would be to tinker with the Google Maps api and see if that can help you.

• ###### 13. Re: Shortest path with dijkstra algorithm

Joshua Ormond wrote:

have it return the shortest route. Grab that, and insert into a field in FM.

Unless it leads through a desert, say …

• ###### 14. Re: Shortest path with dijkstra algorithm

I guess the biggest question, is where are you getting this data for your tables. And if you're retrieving it from elsewhere, perhaps there is already a method for getting the 'shortest distance'. As others have said, maybe you need a feed from a web service that already provides the data (including routing)?

Beverly

1 2 Previous Next