Skip to content

Commit a68efb9

Browse files
committed
Release 4.0.0
1 parent a9d7175 commit a68efb9

File tree

8 files changed

+34
-24
lines changed

8 files changed

+34
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
###4.0.0
2+
- **This is an API breaking change due to addEdge() changes**
3+
- addEdge(_ e: E, directed: Bool) deprecated in favor of just addEdge(_ e: E) since Edge already has a *directed* property (@Vithanco)
4+
- Fix generic paramter name shadowing for Swift 6 compatibility
5+
- Count paths between vertices (@sbeitzel)
6+
- Improve performance of detectCycles() (@automaciej)
7+
- Indegree and Outdegree methods (@TizianoCoroneo)
8+
19
### 3.1.0
210
- Reverse a graph with `reversed()` (@mattpaletta)
311
- Performance improvement to `topologicalSort()` (@dabbott)

CONTRIBUTORS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ SwiftGraph is being used in several real-world and hobby projects. The most nota
1313
## Contributors
1414

1515
SwiftGraph has been worked on by the following people:
16-
- David Kopec (@davecom) - I started the project in 2014 and I have been maintaining it ever since; I wrote most of the code between 2014-2017
17-
- Ferran Pujol Camins (@ferranpujolcamins) - Ferran got us setup with continuous integration, added the `UniqueVerticesGraph` class and its supporting machinery, refactored some of the search algorithms, cleaned up several miscellaneous sections, and is working on Graphviz support. He was the primary force behind SwiftGraph in 2018-2019.
16+
- David Kopec (@davecom) - I started the project in 2014 and I have been maintaining it ever since; I wrote most of the initial code between 2014-2017
17+
- Ferran Pujol Camins (@ferranpujolcamins) - Ferran got us setup with continuous integration, added the `UniqueVerticesGraph` class and its supporting machinery, refactored some of the search algorithms, and cleaned up several miscellaneous sections. He was the primary force behind SwiftGraph in 2018-2019.
1818
- Zev Eisenberg (@ZevEisenberg) - Added the original cycle detection algorithms and provided miscellaneous bug fixes.
1919
- Kevin Lundberg (@klundberg) - Added Carthage support.
2020
- Ian Grossberg (@yoiang) - Helped with Codable support
2121
- Devin Abbott (@dabbott) - Improved the performance of `topologicalSort()`
2222
- Matt Paletta (@mattpaletta) - Added `reversed()`
23+
- Tiziano Coroneo (@TizianoCoroneo) - Added indegree and outdegree methods
24+
- Maciej Bliziński (@automaciej) - Improved detectCycles() performance
25+
- Vithanco (@vithanco) - Improved addEdge()
26+
- Stephen Beitzel (@sbeitzel) - Added counting paths between vertices
2327

24-
Thank you to everyone who has contributed, including those not listed, who made smaller contributions. If I forgot you and you made a significant contribution to SwiftGraph, please make a pull request to this document.
25-
26-
### Designated Successor
27-
28-
Should I become incapacitated, or for some reason I stop responding for more than six months, it's my wish that Ferran takeover the project. If SwiftGraph becomes more popular and we need a more sophisticated governance structure, I'm happy to put that in place.
28+
Thank you to everyone who has contributed, including those not listed, who made smaller contributions. If I forgot you and you made a significant contribution to SwiftGraph, please make a pull request to this document.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ It includes copious in-source documentation, unit tests, as well as search funct
1616

1717
SwiftGraph 3.0 and above requires Swift 5 (Xcode 10.2). Use SwiftGraph 2.0 for Swift 4.2 (Xcode 10.1) support, SwiftGraph 1.5.1 for Swift 4.1 (Xcode 9), SwiftGraph 1.4.1 for Swift 3 (Xcode 8), SwiftGraph 1.0.6 for Swift 2 (Xcode 7), and SwiftGraph 1.0.0 for Swift 1.2 (Xcode 6.3) support. SwiftGraph supports GNU/Linux and is tested on it.
1818

19+
### Swift Package Manager (SPM)
20+
21+
Use this repository as your dependency.
22+
1923
### CocoaPods
2024

2125
Use the CocoaPod `SwiftGraph`.
@@ -25,13 +29,9 @@ Use the CocoaPod `SwiftGraph`.
2529
Add the following to your `Cartfile`:
2630

2731
```
28-
github "davecom/SwiftGraph" ~> 3.1
32+
github "davecom/SwiftGraph" ~> 4.0
2933
```
3034

31-
### Swift Package Manager (SPM)
32-
33-
Use this repository as your dependency.
34-
3535
### Manual
3636

3737
Copy all of the sources in the `Sources` folder into your project.

Sources/SwiftGraph/Search.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,11 @@ struct DijkstraNode<D: Comparable>: Comparable, Equatable {
544544
let vertex: Int
545545
let distance: D
546546

547-
static func < <D>(lhs: DijkstraNode<D>, rhs: DijkstraNode<D>) -> Bool {
547+
static func < <DT>(lhs: DijkstraNode<DT>, rhs: DijkstraNode<DT>) -> Bool {
548548
return lhs.distance < rhs.distance
549549
}
550550

551-
static func == <D>(lhs: DijkstraNode<D>, rhs: DijkstraNode<D>) -> Bool {
551+
static func == <DT>(lhs: DijkstraNode<DT>, rhs: DijkstraNode<DT>) -> Bool {
552552
return lhs.distance == rhs.distance
553553
}
554554
}

Sources/SwiftGraph/UniqueElementsGraph.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ extension UniqueElementsGraph where E == UnweightedEdge {
129129
return g
130130
}
131131

132-
private struct QueueElement<V> {
133-
let v: V
132+
private struct QueueElement<VT> {
133+
let v: VT
134134
let previousIndex: Int
135135
}
136136

Sources/SwiftGraph/WeightedEdge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public struct WeightedEdge<W: Equatable & Codable>: Edge, CustomStringConvertibl
5252
}
5353

5454
//MARK: Operator Overloads
55-
static public func == <W>(lhs: WeightedEdge<W>, rhs: WeightedEdge<W>) -> Bool {
55+
static public func == <WT>(lhs: WeightedEdge<WT>, rhs: WeightedEdge<WT>) -> Bool {
5656
return lhs.u == rhs.u && lhs.v == rhs.v && lhs.weight == rhs.weight
5757
}
5858

SwiftGraph.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'SwiftGraph'
3-
s.version = '3.1'
3+
s.version = '4.0'
44
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
55
s.summary = 'A Graph Data Structure in Pure Swift'
66
s.homepage = 'https://github.com/davecom/SwiftGraph'
@@ -13,5 +13,5 @@ Pod::Spec.new do |s|
1313
s.watchos.deployment_target = '2.0'
1414
s.source_files = 'Sources/SwiftGraph/*.swift'
1515
s.requires_arc = true
16-
s.swift_versions = ['5.0', '5.1', '5.2', '5.3']
16+
s.swift_versions = ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '6.0', '6.1']
1717
end

generate_docs.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
VERSION=$(git describe --tags --abbrev=0)
45

56
jazzy \
67
--clean \
7-
--author David Kopec \
8-
--author_url https://twitter.com/davekopec \
9-
--github_url https://github.com/davecom/SwiftGraph \
8+
--author "David Kopec" \
9+
--author_url "https://twitter.com/davekopec" \
10+
--github_url "https://github.com/davecom/SwiftGraph" \
1011
--github-file-prefix "https://github.com/davecom/SwiftGraph/tree/$VERSION" \
1112
--module-version "$VERSION" \
12-
--module SwiftGraph
13-
13+
--module "SwiftGraph" \
14+
--swift-build-tool spm \
15+
--build-tool-arguments -c,release

0 commit comments

Comments
 (0)