Petri Nets

Petri Nets are a mathematical and graphical modeling tool used to describe distributed systems, concurrent processes, workflows, communication protocols, and manufacturing systems.

What is a Petri Net?

A Petri Net is a directed bipartite graph consisting of places, transitions, and tokens. It was introduced by Carl Adam Petri in the 1960s to model systems where multiple activities can happen simultaneously.

Main Components

Places (○)

Represent conditions, resources, or states in the system.

Transitions (▭)

Represent events or actions that change the state.

Tokens (●)

Represent the current marking (state) of the system.

Arcs

Connect places and transitions and define the flow.

Simple Example

Consider a process where a task starts, executes, and finishes.

(Start) ○ → ▭ Execute → ○ (Done)

Token initially in "Start"

How Firing Works

  1. A transition is enabled when all required input places contain tokens.
  2. The transition fires.
  3. Tokens are removed from input places.
  4. Tokens are added to output places.
  5. The system reaches a new state (marking).

Why Petri Nets Are Useful

  • Model concurrent activities.
  • Analyze synchronization problems.
  • Detect deadlocks and bottlenecks.
  • Verify workflow correctness.
  • Represent distributed systems visually.

Applications

Business Processes

Workflow and BPMN analysis.

Software Engineering

Concurrent and distributed systems.

Manufacturing

Production line optimization.

Network Protocols

Communication and synchronization modeling.

Formal Definition

A Petri Net is commonly defined as:

PN = (P, T, F, W, M₀)

  • P = Set of places
  • T = Set of transitions
  • F = Flow relation (arcs)
  • W = Arc weights
  • M₀ = Initial marking