@@ -73,8 +73,8 @@ extension Graph where E: WeightedEdgeProtocol {
73
73
//github.com/ - parameter from: The index of the starting vertex of the edge.
74
74
//github.com/ - parameter to: The index of the ending vertex of the edge.
75
75
//github.com/ - returns: True if there is an edge from the starting vertex to the ending vertex.
76
- public func edgeExists( from : Int , to : Int , withWeight weight: W ) -> Bool {
77
- return edgeExists ( E ( u: from , v: to , weight: weight) )
76
+ public func edgeExists( fromIndex : Int , toIndex : Int , withWeight weight: W ) -> Bool {
77
+ return edgeExists ( E ( u: fromIndex , v: toIndex , weight: weight) )
78
78
}
79
79
80
80
//github.com/ Check whether there is an edge from one vertex to another vertex with a specific weight.
@@ -88,7 +88,7 @@ extension Graph where E: WeightedEdgeProtocol {
88
88
public func edgeExists( from: V , to: V , withWeight weight: W ) -> Bool {
89
89
if let u = indexOfVertex ( from) {
90
90
if let v = indexOfVertex ( to) {
91
- return edgeExists ( from : u, to : v, withWeight: weight)
91
+ return edgeExists ( fromIndex : u, toIndex : v, withWeight: weight)
92
92
}
93
93
}
94
94
return false
@@ -99,8 +99,8 @@ extension Graph where E: WeightedEdgeProtocol {
99
99
//github.com/ - parameter from: The index of the starting vertex of the edge.
100
100
//github.com/ - parameter to: The index of the ending vertex of the edge.
101
101
//github.com/ - returns: True if there is an edge from the starting vertex to the ending vertex.
102
- public func edgeExists( from : Int , to : Int ) -> Bool {
103
- return edges [ from ] . map ( { $0. v} ) . contains ( to )
102
+ public func edgeExists( fromIndex : Int , toIndex : Int ) -> Bool {
103
+ return edges [ fromIndex ] . map ( { $0. v} ) . contains ( toIndex )
104
104
}
105
105
106
106
//github.com/ Check whether there is an edge from one vertex to another vertex.
@@ -114,7 +114,7 @@ extension Graph where E: WeightedEdgeProtocol {
114
114
public func edgeExists( from: V , to: V ) -> Bool {
115
115
if let u = indexOfVertex ( from) {
116
116
if let v = indexOfVertex ( to) {
117
- return edgeExists ( from : u, to : v)
117
+ return edgeExists ( fromIndex : u, toIndex : v)
118
118
}
119
119
}
120
120
return false
0 commit comments