← Back to Petri-Pilot

What is a Petri Net?

A visual language for describing systems that have state and change over time.

Three Building Blocks

Every Petri net is built from just three things:

Place arc Transition arc Place
A token sits in the left place. When the transition fires, it moves the token to the right place.

Tokens Make It Go

Tokens are the dots inside places. They represent the current state of the system — like game pieces on a board. A transition can only fire (happen) when every input place has at least one token.

When a transition fires:

That's it. This simple rule is enough to model surprisingly complex systems.

Think of it like a board game. Places are the spaces on the board. Tokens are the pieces. Transitions are the moves you can make. The arcs say which spaces connect to which moves.

A Real Example: Traffic Light

A traffic light has three states: red, green, and yellow. Only one can be active at a time. Here's how we model it:

red green yellow go slow stop
One token cycles: red → go → green → slow → yellow → stop → red. The token starts at "red".

The token starts in red. Only the go transition can fire (because red is its input). When it fires, the token moves to green. Now only slow can fire. And so on, forever. This net is:

Try the Stoplight demo →

Why Not Just Use a Flowchart?

Flowcharts only show one thing happening at a time. Petri nets can show multiple things happening at once. This is because tokens move independently — you can have many tokens in many places, all at the same time.

Flowchart can't show:

Two cooks working in a kitchen simultaneously, sharing the same oven.

Petri net can show:

Two tokens (cooks) moving independently, both needing a token from the "oven available" place.

This makes Petri nets perfect for modeling:

Places, Transitions, Arcs — That's Really It

Every demo on this site, from a coffee shop to a poker hand classifier to predator-prey ecology, is built from the same three elements. The only difference is how you connect them.

The big idea: Simple rules, complex behavior. A few circles, rectangles, and arrows can describe everything from a traffic light to a biochemical reaction.

Try It Yourself

The Petri Net Viewer lets you browse every model on this site and build your own. Start with the Stoplight (three places, three transitions) and work up to the Tic-Tac-Toe (34 places, 36 transitions).

Open the Petri Net Viewer →

Ready to go deeper?

Thinking in Petri Nets: Patterns, Properties & Design →