https://github.com/seatonullberg/ugraph
C89 undirected graph implementation.
https://github.com/seatonullberg/ugraph
c data-structures graphs undirected-graphs
Last synced: 12 months ago
JSON representation
C89 undirected graph implementation.
- Host: GitHub
- URL: https://github.com/seatonullberg/ugraph
- Owner: seatonullberg
- License: mit
- Created: 2020-09-11T20:43:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-11T02:05:48.000Z (over 5 years ago)
- Last Synced: 2025-02-03T11:50:56.067Z (about 1 year ago)
- Topics: c, data-structures, graphs, undirected-graphs
- Language: C
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ugraph
C89 undirected graph implementation.
## Usage
`ugraph` exposes a simple yet flexible API for constructing and querying undirected graphs. Each vertex and edge can hold a `void *` field for users to store generic data directly in the graph. Edges between vertices are implemented as a `HashTable`. This design choice means that each pair of vertices may have 0 or 1 edges between them, but never more.
The [unit tests](tests/ugraph.c) and [benchmark suite](benches/ugraph.c) serve as examples of how to appropriately use the API.
The code can be built as a shared library by running `make shared` in the parent directory.