     /// - returns: An array of Edges containing the entire route, or an empty array if no route could be found
     public func dfs(from: V, goalTest: (V) -> Bool) -> [E] {
         if let u = indexOfVertex(from) {
-            return dfs(from: u, goalTest: goalTest)
+            return dfs(fromIndex: u, goalTest: goalTest)
         }
         return []
     }
     
     /// Find a route from one vertex to another using a depth-first search.
     ///
-    /// - parameter from: The index of the starting vertex.
-    /// - parameter to: The index of the ending vertex.
-    /// - returns: An array of Edges containing the entire route, or an empty array if no route could be found
-    public func dfs(from: Int, to: Int) -> [E] {
+    /// - parameter fromIndex: The index of the starting vertex.
+    /// - parameter toIndex: The index of the ending vertex.
+    /// - returns: An array of Edges containing the entire route, or an empty array if no route could be found
+    public func dfs(fromIndex: Int, toIndex: Int) -> [E] {
         // pretty standard dfs that doesn't visit anywhere twice; pathDict tracks route
         var visited: [Bool] = [Bool](repeating: false, count: vertexCount)
         let stack: Stack<Int> = Stack<Int>()
         var pathDict: [Int: Edge] = [Int: Edge]()
-        stack.push(from)
+        stack.push(fromIndex)
         while !stack.isEmpty {
             let v: Int = stack.pop()
-            if v == to {
-                // figure out route of edges based on pathDict
-                return pathDictToPath(from: from, to: to, pathDict: pathDict) as! [Self.E]
+            if v == toIndex {
+                // figure out route of edges based on pathDict
+                return pathDictToPath(from: fromIndex, to: toIndex, pathDict: pathDict) as! [Self.E]
             }
             visited[v] = true
             for e in edgesForIndex(v) {

    /// Find a route from a vertex to the first that satisfies goalTest()
    /// using a depth-first search.
    ///
    /// - parameter from: The index of the starting vertex.
    /// - parameter goalTest: Returns true if a given vertex is a goal.
    /// - returns: An array of Edges containing the entire route, or an empty array if no route could be found
    public func dfs(from: Int, goalTest: (V) -> Bool) -> [E] {
        // pretty standard dfs that doesn't visit anywhere twice; pathDict tracks route
        var visited: [Bool] = [Bool](repeating: false, count: vertexCount)
        let stack: Stack<Int> = Stack<Int>()
        var pathDict: [Int: E] = [Int: E]()
        stack.push(from)
        while !stack.isEmpty {
            let v: Int = stack.pop()
            if goalTest(vertexAtIndex(v)) {
                // figure out route of edges based on pathDict
                return pathDictToPath(from: from, to: v, pathDict: pathDict) as! [Self.E]
            }
            visited[v] = true
            for e in edgesForIndex(v) {

    public func dfs(from: V, to: V) -> [E] {
        if let u = indexOfVertex(from) {
            if let v = indexOfVertex(to) {
                return dfs(fromIndex: u, toIndex: v)
            }
        }
        return []
