Skip to content

Graph Analysis

The UI-free graph helpers run over a graph you can edit: BlowGraphAlgorithms for order, cycles, components, reachability and shortest routes, BlowGraphValidator for rules, and search to take you to what you are looking for. Pick an analysis; the answer is marked on the graph and listed beside it, and recomputed after every edit.

failedretryvalidfixed
Orders
Load
Check
Fix
Manual entry
Merge
Save
Audit
Settings
Cache
Warm up
Sticky note
bit Blow

Try it

  • Dependency order numbers the nodes so each comes after everything with an edge into it. Load, Check and Fix go round in a loop through the retry edge, so they - and everything after them - cannot be ordered; click the retry edge and press Delete and the whole graph gets an order.
  • Cycles says whether there is a loop and marks each one, its edges included; with retry deleted, drag from Audit's handle back to Load to make a bigger one. Strongly connected groups the nodes that can all reach one another; Connected pieces colours the separate parts the graph falls into.
  • Upstream and downstream: click a node to see everything it depends on and everything that depends on it, and whether it is on a cycle. Neighbourhood walks out from the selected node, numbering each node by how many edges away it is; pick the Direction and the Depth.
  • Shortest path marks the route with the fewest edges between From and To. Tick Weigh edges by length to find the shortest route as drawn instead, then drag Check or Fix far away and watch the route switch sides.
  • Roots, leaves and loose ends marks where flows start and end, the node with no edges, and the steps no input reaches. Statistics lists the counts.
  • Validation checks the graph against rules: Audit's dead end is an error, the loop, the note and Manual entry are warnings, and the list adds an issue for information only. Drag from Audit's handle to Save to clear the error. Set Max issues to 3 and the report stops after the loop's three warnings, before the rule that finds the error has run.
  • Search: type rows, cache or retry. Matching nodes and edges are marked and listed best first; Select all matches selects them.
  • In every analysis, press an entry in the list to have the view glide to that node or edge, select it and give it keyboard focus.

How it works

  • Each run builds one BlowGraphIndex(nodes, edges) - the lookups by id and the incoming and outgoing edges - and asks it every question of that analysis. The helpers have no UI, never recurse, and run in time linear in the size of the graph.
  • TopologicalSort(graph) returns the Order and the Unordered nodes a cycle blocks, and IsAcyclic. HasCycle(graph) answers yes or no; FindCycles(graph) returns each group of nodes on a cycle.
  • StronglyConnectedComponents(graph) returns the groups of mutually reachable nodes, in reverse topological order; ConnectedComponents(graph) the pieces the graph falls into when direction is ignored.
  • GetAncestors(graph, id) and GetDescendants(graph, id) list what is upstream and downstream, nearest first. IsReachable(graph, from, to) says whether one node leads to another; a node reaches itself only through a cycle. Traverse(graph, id, direction, maxDepth) is the general walk behind them; the page calls it with growing depths to number each node by its distance.
  • ShortestPath(graph, from, to) finds the fewest-edges route, or null when there is none. Given a weight function - here the distance between the two nodes' centres - it finds the cheapest one instead (Dijkstra).
  • GetRoots, GetLeaves and GetIsolatedNodes find where flows start and end and what is disconnected; GetUnreachable(graph, startIds), started from the input nodes, finds what can never run. GetStatistics(graph) counts nodes, edges, roots, leaves, components, self-loops, degrees, dangling edges and whether the graph is acyclic.
  • BlowGraphValidator.CreateDefault() holds the Structure and Ports rules; the page adds NoCycles(BlowValidationSeverity.Warning), NoIsolatedNodes() and AllReachableFrom(n => n.Type == "input") (warnings by default), a rule of its own implementing IBlowValidationRule - a step that ends the flow must be an output, an error - and an information-only issue added as a function. MaxIssues bounds the report and sets IsTruncated.
  • The BlowValidationResult goes to the canvas's Validation parameter, which marks errors and warnings by shape as well as colour; Info issues are not marked. Each BlowValidationIssue carries a Code, a Severity, a Message and the NodeId or EdgeId it concerns, which is how the list takes you there.
  • FindNodes(query, text) and FindEdges(query) search what is shown - labels, ids, types, the names of an edge's two nodes, plus the description in each node's Data through the text function - ignoring case and accents, best matches first. SelectAsync(nodes, edges) selects them; FocusNodeAsync and FocusEdgeAsync with select: true take you to one.
  • The marks are the nodes' own Class and Style, the edges' Class, and a badge drawn by the NodeTemplate beside the built-in BlowDefaultNode; each run clears the last one's first.
An unhandled error has occurred. Reload 🗙