I have an app for creating simple graphs (the kind with vertices and edges) and then using different algorithms on them (BFS, DFS, topsort, Prim's etc) for demonstrating how they work.I'm now working on porting it into a Rails app and deploying so it can be used by my university (hopefully). Currently the graphs are stored in a SQLite db and I am planning to do some D3 magic on them. Then to the real problem, how should I implement and store the algorithms?I want to be able to step through the algorithm, showing step by step how it works on the graph. In my previous implementation, written in Java, I had an abstract Algorithm class with abstract methods like init, step and reset. But, now that we are out of the Java world and using wonderful Ruby, I have a feeling that there's a really clever and elegant way achieving the same. I am planning to pack it into a Rails engine, just for kicks.Here is the mentioned Java implementation: https://github.com/7SLEVIN/visualgraphalgs
Storing different algorithms and using them for demonstration
algorithms;ruby;ruby on rails