apple / apple/swift-algorithms
Graph Structure
- Dominant language
- Swift
- Stars
- 6.3k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
Apologies if this has been discussed, I looked just about everywhere I could think before creating the feature. I recently came into a need for a graph with a topological sort and was somewhat surprised to see there just don't appear to be Swift implementations that are really ready to use. There's some sparse projects that are kinda getting there...and then there's [Swift Algorithm Club](https://github.com/kodecocodes/swift-algorithm-club/tree/master/Topological%20Sort) at least demonstrating how it could be pulled off.
To that end, I wonder if this library could benefit from an `AdjacencyListGraph` sequence type. I know that it'd be useful in a few different things I'm building, and building the data structure per project is a bit daunting. I'm hardly a Graph expert, but assuming general support, I'd be happy to create a draft PR for it and take on the dev effort.
Contributor guide
Research direction
The issue does not identify a repository file or test. Start with the linked Swift Algorithm Club Topological Sort example and assess how an AdjacencyListGraph sequence type would fit this library. Done should be an agreed graph API with topological-sort support and corresponding tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100