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

    /// - 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 []
    }
    
    /// 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] {
        // 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)
        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]
            }
            visited[v] = true
            for e in edgesForIndex(v) {

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