State-Transition Diagram Calculator

Design states and transitions, validate probabilities, simulate episodes, inspect matrices, explore Markov behavior, analyze rewards, and export clear machine-learning diagrams instantly online for learning.

Analysis Results

Results update after calculation or simulation.

States
0
Transitions
0
Probability status
Not checked
Initial state
Terminal states
0
Reachable states
0
Expected immediate reward
0
Steady-state status

Validation and warnings

  • Load data and calculate the diagram.

Key findings

No analysis has been completed.

Project and Data Controls

Load examples, paste data, import files, or restore saved browser sessions.

States are created automatically when missing.

State Definitions

Configure initial, terminal, grouped, valued, colored, shaped, and manually positioned states.

#NameDescriptionInitialTerminalGroupValueColorShapeXYActions

Transition Definitions

Add action labels, probabilities, rewards, costs, counts, conditions, loops, and bidirectional links.

#SourceDestinationActionProbabilityRewardCostCountLabelConditionBidirectionalEnabledActions

Calculation, Probability, and Reinforcement-Learning Options

Choose validation behavior, Markov steps, policies, rewards, and simulation settings.

Interactive State-Transition Diagram

Drag states, change layouts, filter edges, highlight paths, and export the finished graph.

Select start and destination states to highlight a path.

Matrices and Detailed Analysis

Inspect transition, reward, multi-step, stationary, policy, absorption, and visitation outputs.

No matrix available.
No matrix available.
No matrix available.
No steady-state calculation available.
No absorption calculation available.
No policy calculation available.
No simulation has been run.

Formula Used

The calculator applies standard Markov-chain and reinforcement-learning relationships.

Transition matrix:
Pij = Pr(Xt+1 = j | Xt = i)

n-step distribution:
π(n) = π(0)Pn

Stationary distribution:
π = πP, with Σπi = 1
Bellman expectation:
V(s) = Σaπ(a|s)Σs′P(s′|s,a)[R + γV(s′)]

Fundamental matrix:
N = (I − Q)−1

Expected absorption steps:
t = N1

How to Use

  1. Add state names and mark the initial or terminal states.
  2. Add directed transitions with actions, probabilities, and rewards.
  3. Choose probability, policy, layout, and simulation options.
  4. Select Calculate and draw to validate and analyze the model.
  5. Inspect matrices, paths, steady-state values, and absorption results.
  6. Run episodes, then export the diagram or calculated tables.

Example Data

SourceDestinationActionProbabilityReward
StartState AMove0.702
StartState BWait0.30-1
State AEndFinish1.0010
State BState ARetry0.601
State BEndQuit0.40-5

Frequently Asked Questions

What is a state-transition diagram?

It shows system states as nodes. Directed arrows show possible transitions. Labels can display actions, probabilities, rewards, or conditions.

Can this calculator model Markov chains?

Yes. It creates transition matrices and multi-step probabilities. It also estimates stationary and absorbing-chain behavior.

Must outgoing probabilities total one?

Strict mode requires totals of one. Normalize mode adjusts positive values automatically. Allow mode keeps incomplete probability totals.

How are terminal states handled?

Terminal states can stop simulations. Optional self-loops make them absorbing. Absorption calculations use the resulting canonical matrix.

Can I model reinforcement-learning rewards?

Yes. Add rewards, costs, actions, and discounting. The calculator estimates state values using Bellman iteration.

What does steady state mean?

It is a long-run probability distribution. Applying the transition matrix leaves it unchanged. Some chains have no unique stationary result.

Can I import transition data?

Yes. Import CSV or JSON files. You can also paste comma-separated transition rows.

How are multiple transitions combined?

Transitions between identical state pairs are aggregated. Their probabilities are added. Reward values use probability-weighted averages.

Can I export the diagram?

Yes. Export PNG, SVG, PDF, CSV, or JSON. Browser sessions can also be saved locally.

Current Configuration Preview

Configuration preview will appear here.

Related Calculators

Episode Reward CurveAverage Reward CurveEpisode Length PlotExploration Rate CurveValue Function HeatmapPolicy HeatmapQ-Value PlotRegret CurveSuccess Rate Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.