t-spanner-greedy algorithm
This is a repository for my Python implementation of a t-spanner greedy algorithm. I used the adjancency list representations of Graph. Implemented Node and Edge classes separately. A careful algorithm geek might suspect a lot of space is going to be taken, so a little tweaking might be in great need. Nonetheless, I hope the implementation drives the point home, in order to show that these kinds of algorithms are all about. Which is, as t gets bigger and bigger, the t-spanner, precisely resembles a minimum weight spanning tree.
To run the application, you need to first check if you meet the requirements.txt
(pun intended!), or if you prefer using Anaconda, the .yml
file under the same name. I'm not a pro PyQt user, so I'm guessing you find my implemenation annoying, but I marked the algorithm in the main.py by comments, and abstracted away the graph, vertex, etc. implementations away on a digraph
package. Ultimately, running python main.py
will run the program.
If you want to find a quick overview on the subject, and graph spanners in general, this paper would be a great starter. For a special analysis on the subject, check this article on the same matter.
Early 90s researchs of professors Narasimhan and Das are invaluable to this end, and I highly recommend checking them.
Other references:
- For diving deeper into the Weighted Graph Algorithms with Python
- networkx is a great package if you're not really into implementing things by yourself.
- Edith Cohen, Fast algorithms for constructing t-spanners and paths with stretch t, AT&T Bell Laboratories Murray Hill, NJ 07974, 1993