I finished my first graduate course earlier this summer. Part of the course was this, to implement a graph algorithm in ActionScript. I chose the Floyd–Warshall algorithm and I thought I’d post what I came up with.
Here are the files I have uploaded that you can try it with:
- test.xml – A simple graph where each node is connected to the following node.
- test-d.xml – Same as the previous one, but this one is directed.
- shorter.xml – Also simple, with each node connected to the next. Because of the weights, it is shorter to go the “long way” to get from n1 to n5, and you can watch the algorithm find this shorter path.
- negative.xml – Graph with a negative cycle.
I’ve removed the voice-over from this presentation. The click sound-effect is still present if you click the full-screen link above.
And here it is!
I can say with absolute certainty that ActionScript is not my favorite language to program in. But, I’ll write more on the ActionScript programming experience later.