Simulation · deterministic model

Knowledge graph explorer: BFS, DFS and paths

Define entities and the relationships between them, then run breadth-first and depth-first traversal over the same graph and watch the two produce completely different journeys.

Workspace/graph
RUNS LOCALLY

Graph explorer

Say it the way you would say it to a person. Your words are matched to one of 18 tools by readable rules, and the tool runs right here in your browser. No upload, no account.

/ tools⌘K search↑ last message

Graph explorerRuns on this device · nothing uploaded

This tool runs in your browser and needs JavaScript turned on.

How to use the graph explorer

  1. List the relationships in the settings form, one node per line: Company -> Supplier, Investor. An example graph is filled in.
  2. Pick a start node, and a target if you want a path: “shortest path from Research to Answer”.
  3. Compare “breadth-first search from Research” with “depth-first search from Research”.
  4. Read the visit order and the path found, and switch the arrows between one-way and two-way.

Things you can type: breadth-first search from Research to Answer depth-first search from Research

Two ways to walk the same graph

Breadth-first explores in rings: everything one step away, then everything two steps away. It finds the shortest path, and it is what you want when the question is "how are these two things connected".

Depth-first commits to a branch and follows it to the end before backing up. It reaches distant nodes sooner and it will happily return a path six hops long when a two-hop path existed.

Running both over the same graph, with the same start, is the fastest way to internalise the difference — and to know which one a system you are using has chosen.

Why this matters for research

A knowledge graph is how a research system stops treating documents as a bag of text. Entities become nodes, relationships become edges, and questions that no amount of chunking answers — which suppliers connect these two companies, which papers cite the one that was retracted — become traversals.

It is also the structure behind graph-based retrieval, where the neighbourhood of a matched entity is retrieved along with the passage.

What you get

  • A graph from one line per node: Company -> Supplier, Investor.
  • Directed or undirected edges.
  • The full visit order for either algorithm.
  • The path found between a start and a target, when one exists.

Questions

Graph explorer: common questions

When is depth-first the better choice?

When you need to reach a deep node quickly, enumerate complete paths, or detect cycles. For shortest paths on an unweighted graph, breadth-first is the correct tool and depth-first is a trap.

Does this build a knowledge graph from my documents?

No — you define the nodes and edges here. Extracting entities and relationships from a document library automatically is part of the FlexContext roadmap rather than this page.

How large a graph can it handle?

Comfortably into the hundreds of nodes. It is built for understanding the algorithms, not for production graph workloads.