Weighted graph algorithms with Python
A. Kapanowski, {\L}. Ga{\l}uszka

TL;DR
This paper presents a Python library implementing various weighted graph algorithms with a unified interface, supporting multiple algorithms for minimum spanning trees and shortest path problems, tested for correctness and performance.
Contribution
It introduces a modular Python framework for weighted graph algorithms with a unified design and multiple algorithm implementations, including testing and performance analysis.
Findings
Algorithms are correctly implemented and tested with unittest.
Performance experiments compare real and theoretical complexities.
The source code is publicly available on GitHub.
Abstract
Python implementation of selected weighted graph algorithms is presented. The minimal graph interface is defined together with several classes implementing this interface. Graph nodes can be any hashable Python objects. Directed edges are instances of the Edge class. Graphs are instances of the Graph class. It is based on the adjacency-list representation, but with fast lookup of nodes and neighbors (dict-of-dict structure). Other implementations of this class are also possible. In this work, many algorithms are implemented using a unified approach. There are separate classes and modules devoted to different algorithms. Three algorithms for finding a minimum spanning tree are implemented: the Boruvka's algorithm, the Prim's algorithm (three implementations), and the Kruskal's algorithm. Three algorithms for solving the single-source shortest path problem are implemented: the dag…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMultidisciplinary Science and Engineering Research · Data Management and Algorithms
