What is SwiftGraph?

SwiftGraph is a pure Swift (no Cocoa) implementation of a graph data structure, appropriate for use on all platforms Swift supports (iOS, macOS, Linux, etc.). It includes support for weighted, unweighted, directed, and undirected graphs. It uses generics to abstract away both the type of the vertices, and the type of the weights.

It includes copious in-source documentation, unit tests, as well as search functions for doing things like breadth-first search, depth-first search, and Dijkstra’s algorithm. Further, it includes utility functions for topological sort, Jarnik’s algorithm to find a minimum-spanning tree, detecting a DAG (directed-acyclic-graph), and enumerating all cycles.

Overview

  • Pricing: Free
  • Resource Link: https://github.com/davecom/SwiftGraph
  • Resource Maker on Twitter: David Kopec
  • Mobile Platform Destination: iOS Apps
  • Mobile Platform Support: Native iOS
  • Programming Languages: Swift
  • CocoaPods: SwiftGraph
  • Carthage: davecom/SwiftGraph