Repository navigation
Version Packages - #41
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
github-actions
Bot
force-pushed
the
changeset-release/main
branch
2 times, most recently
from
October 1, 2026 17:32
d9e27c7 to
3a65c5f
Compare
github-actions
Bot
force-pushed
the
changeset-release/main
branch
from
October 1, 2026 20:06
3a65c5f to
9acbf12
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@statelyai/graph@2.5.0
Minor Changes
#43
e87aceeThanks @davidkpiano! - Tighten algorithm contracts:getMinCuttakes{ from, to }(was{ source, sink }) and returnscutEdgesas edge objects, matchinggetMaxFlow.getMaxFlow,getMinCut, andgetSteinerTreereturnundefined(getSteinerTreealso when the terminals are disconnected),getDominatorTreereturns{},hasPath(g, x, x)isfalsefor an unknownx, and path queries no longer yield a trivial self-path for an unknown source.getDegreecounts every self-loop twice, including non-directed ones, so degrees sum to2 × edges.length.hasPathaccepts{ direction }and runs on the CSR snapshot.isAcyclicis iterative, so deep graphs no longer overflow the call stack, runs in O(n + m) for graphs mixing directed and non-directed edges (previously exponential in the worst case), and is cached until the graph changes.genCyclesis now lazy: Johnson's algorithm per biconnected block, iterative, O((n + m) · (cycles + 1)). Taking the first cycle of a dense graph no longer enumerates all of them first, and long cycles no longer overflow the call stack. Cycle order may differ.getCyclereturns one cycle (orundefined) in O(n + m).isTreereturnsfalsefor the empty graph. It ignores edge direction (a → c ← bis a tree).isArborescencechecks for a rooted tree whose edges all point away from the root, optionally at{ from }.genTopologicalSort; both topological sorts accept{ from }to emit chosen nodes first.genShortestPaths,genSimplePaths,genCycles,genAllPairsShortestPaths,genShortestSimplePaths,genPreorders,genPostorders,genGirvanNewmanCommunities) no longer return wrong results or crash when the graph is mutated mid-iteration.getDepthreturnsundefined(was-1) for an unknown node, andisLeaf/isCompoundreturnfalsefor one.isIsomorphicis a VF2-style matcher: breadth-first matching order, candidates from neighbors of matched nodes, O(degree) checks, iterative. Large sparse graphs that previously never finished now take milliseconds. It also no longer pairs a directed self-loop with a non-directed one, and pairs parallel edges exactly underedgeMatchinstead of greedily.genSimplePaths/getSimplePath, tied shortest-path reconstruction (genShortestPaths, Floyd–Warshall),getDescendants,deleteNodecascades,getFlattenedGraph,getTransitiveReduction, and maximum bipartite matching are iterative.genPreorders/genPostordersbacktrack with an undo log instead of copying state per step (a chain no longer costs O(n²)), and no longer drop orders that end at a dangling edge.getPreorderno longer rescans neighbors when returning to a node.getTransitiveReductionno longer crashes on an edge from a missing node.WeakRefmemo, which kept every graph indexed during one synchronous call alive until it returned (e.g. ~2.8 GB forgetShortestSimplePathson a 3,000-node chain, now ~200 MB).getModularityruns in O(n + m) (was quadratic in community size), ignores dangling edges, and tolerates unknown ids in communities.getFlattenedGraphruns in linear time on deep hierarchies (was quadratic) by resolving leaf ranges and initial states once.getMaxFlow/getMinCutandgetGreedyModularityCommunitiesno longer crash on dangling edges; random walks no longer step onto them.getTSPTourreturnsundefinedfor an unknownfrom(previously started at the first node);genPredefinedWalkyields nothing from an unknown start;getCoverageno longer counts an unknown start node as visited.#39
047e583Thanks @davidkpiano! - Add@statelyai/graph/xstatewithcreateGraphFromMachine(machine, options?): one machine→graph path that enumerates events from the machine's own descriptors, serializes nodes as{ value, context }(same ids asxstate/graph), and attaches guard text (hypothesized: true), actions, and selected transition definitions to edges.getCoverageTargetson the result yields stable state / transition / transition-pair targets.xstatev5 is an optional peer dependency.Patch Changes
#40
898a277Thanks @davidkpiano! - Preserve quoted Mermaid state stereotypes and flowchart labels while expanding compact links and semicolon-separated statements correctly.#42
db0f3e5Thanks @davidkpiano! - ExportFlowchartClickfrom the Mermaid subpath and document literal Mermaid data fields.