Base Graph
Functions
Overload of fun bfs(startNodes: List
Performs a Breadth-First Search, which finds the shortest path from the starting node to all other nodes, assuming the graph is unweighted (all edges have a weight of 1.0) It stores results that can be retrieved with the following functions:
Retrieves a list of all visited nodes on the order they were visited during the last search operation (DFS, BFS, Dijkstra).
Retrieves the shortest distance between two nodes in the graph.
Retrieves the distance to the specified node from the starting node of the most recent search operation (BFS, Dijkstra).
Executes the Floyd-Warshall algorithm on the graph to compute the shortest paths between all pairs of nodes.
Checks if the target node was found during the most recent search operation (BFS, Dijkstra).
Retrieves the node that is the farthest from the starting node in the most recent search operation (BFS, Dijkstra).
Retrieves the maximum distance from the starting node to any other node of the most recent search operation (BFS, Dijkstra).
Computes the Minimum Spanning Tree (MST) of the graph using Prim's algorithm.
Retrieves a list the neighboring nodes of the specified node.
Removes the edge(s) between two nodes in the graph.
Clears the search results stored in the graph.
Identifies groups where each node is reachable from every other node in the group.
Builds an order of nodes so that the first nodes has no outgoing edges, then nodes with edges pointing to these and so on, assuming the graph is a Directed Acyclic Graph (DAG). This is done by running a DFS from each node and ordering the nodes by descending depth (post-order).
Retrieves a (unordered) list of all visited nodes during any non-reset search operation (DFS, BFS, Dijkstra).
Visualizes the graph with Bruno Silva's JavaFXSmartGraph library.