https://github.com/dnbaker/gds
Graph Data Structures: Generic, Space-efficient Graph Algorithms
https://github.com/dnbaker/gds
union-find
Last synced: 5 days ago
JSON representation
Graph Data Structures: Generic, Space-efficient Graph Algorithms
- Host: GitHub
- URL: https://github.com/dnbaker/gds
- Owner: dnbaker
- License: mit
- Created: 2017-06-18T19:11:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T13:15:22.000Z (over 7 years ago)
- Last Synced: 2025-03-01T14:33:06.152Z (over 1 year ago)
- Topics: union-find
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## GDS: Graph Data Structures
#### Union-Find
Implementations:
1. dsv.h: Disjoint-Set Vector.
* Vector-based index implementation. This manages storage for objects and uses less memory but is less flexible.
* Overhead: 3 bits + `sizeof(size_type) * CHAR_BIT` per element, plus `sizeof(void *) * 2 + sizeof(std::vector::size_type)` for the vector.
2. ufa.h: Union-Find Adapter.
* Inheritance and free functions. This is more flexible, but requires manual resource management and requires more memory because it works with pointers (8-bytes) instead of integers of a user-specified size.
* Overhead: `alignof(T) % sizeof(T) + sizeof(void *)` per element.
#### TODO:
1. Topological Sort
2. Kruskal's Algorithm: Topological Sort
3. Additional Graph Algorithms...