Zum Inhalt springen

Petri Nets — Non-Technical Introduction

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Petri Nets — Introduction for Non-Technical Readers

Section titled “Petri Nets — Introduction for Non-Technical Readers”

A Petri net is a visual language for describing how things flow through a system. It was invented in 1939 by German computer scientist Carl Adam Petri as a way to model concurrent systems — systems where multiple things happen at the same time, depend on each other, and compete for shared resources.

The core idea is simple: draw circles and bars, connect them with arrows, and move dots around. The circles represent places where something can be (a waiting room, a buffer, a condition). The bars represent events that change the state (a machine starting, a request being approved, a part being assembled). The dots — called tokens — show what currently exists in each place.

Traditional flowcharts force you into a single path: step A leads to step B leads to step C. Real systems are messier. Two tasks can happen in parallel. A resource might be needed by three different processes at once. A step might wait for two independent conditions before it can fire. Petri nets handle all these patterns naturally because they were designed for concurrency from the start.

Strength Traditional Flowchart Petri Net
Single path Yes Yes
Parallel execution Cumbersome Native
Resource sharing Ad-hoc Built-in
Deadlock detection Manual analysis Structural analysis
Visual clarity Good for simple cases Good for complex cases

Every Petri net consists of exactly three elements:

Places (circles): A place represents a condition or a location. Think of it as a bucket that can hold tokens. A place might represent “order received”, “machine available”, or “customer waiting”. Places are passive — they just hold state.

Transitions (bars or rectangles): A transition represents an event or an action. It fires when all its input places have enough tokens. When it fires, it consumes tokens from input places and produces tokens in output places. A transition might represent “process order”, “assemble product”, or “send invoice”.

Tokens (dots): A token represents an instance of something — a part, a request, a person, a piece of data. Tokens move through the net as transitions fire. The number of tokens in a place tells you how many instances are currently at that stage.

Arcs (arrows): Arcs connect places to transitions and transitions to places. They define the flow direction. A place can only feed a transition if there is an arc between them. A transition can only produce tokens in a place if there is an arc between them.

Imagine a coffee machine:

  1. A place called “empty cup available” holds tokens representing clean cups.
  2. A transition called “brew coffee” has two input arcs: one from “empty cup available” and one from “coffee grounds loaded”.
  3. When both places have at least one token, the transition can fire.
  4. Firing consumes one cup and one set of grounds, then produces a token in the place “coffee ready”.

If you run out of cups, brewing stops — not because of a rule, but because the token count makes it impossible. This is how Petri nets naturally model resource constraints.

Petri nets are not just academic. They are used in:

  • Manufacturing: modeling assembly lines, detecting bottlenecks, verifying that deadlocks cannot occur
  • Workflow systems: describing business processes, checking that every path completes
  • Protocol verification: proving that communication protocols cannot enter invalid states
  • Traffic control: modeling intersection lights, analyzing congestion patterns
  • Healthcare: mapping patient flow through a hospital, identifying waiting time hotspots

This introduction covers the intuition. The next entries in this series will cover formal notation (the mathematical definition), analysis techniques (reachability, liveness, boundedness), and practical tools for building and simulating Petri nets.