Fix kruskal's exception message for directed graph (#138)

This commit is contained in:
Diego Paiva 2018-08-06 10:26:22 -03:00 committed by Oleksii Trekhleb
parent 88bbfdc470
commit 941feda305

View File

@ -10,7 +10,7 @@ export default function kruskal(graph) {
// It should fire error if graph is directed since the algorithm works only // It should fire error if graph is directed since the algorithm works only
// for undirected graphs. // for undirected graphs.
if (graph.isDirected) { if (graph.isDirected) {
throw new Error('Prim\'s algorithms works only for undirected graphs'); throw new Error('Kruskal\'s algorithms works only for undirected graphs');
} }
// Init new graph that will contain minimum spanning tree of original graph. // Init new graph that will contain minimum spanning tree of original graph.