addEdge(vertex1, vertex2, weight, transform) {
        if (weight < 0) {
            $.console.error("WeightedGraph: negative weights will make for invalid shortest path computation!");
        }
        const outgoingPaths = this.adjacencyList[vertex1],
            replacedEdgeIndex = outgoingPaths.findIndex(edge => edge.target === this.vertices[vertex2]),
            newEdge = { target: this.vertices[vertex2], origin: this.vertices[vertex1], weight, transform };
        if (replacedEdgeIndex < 0) {
            this.adjacencyList[vertex1].push(newEdge);
            return true;
        }
        this.adjacencyList[vertex1][replacedEdgeIndex] = newEdge;
        return false;
    }
Add edge to graph
@param vertex1 id, must exist by calling addVertex()
@param vertex2 id, must exist by calling addVertex()
@param weight
@param transform function that transforms on path vertex1 -> vertex2
@return {boolean} true if new edge, false if replaced existing