A Petri Net is a formal, graphical, and mathematical modeling language used to describe and analyze systems characterized by concurrency, synchronization, and resource sharing. Its core components are places (circles representing conditions or resources), transitions (rectangles representing events or actions), tokens (dots within places representing the current state), and directed arcs that connect them. The distribution of tokens across places defines the system's marking, which represents its current global state. Transitions fire when enabled, consuming tokens from input places and producing tokens in output places, modeling dynamic state changes.
Glossary
Petri Net

What is a Petri Net?
A mathematical modeling language for describing and analyzing concurrent, asynchronous, and distributed systems.
In the context of heterogeneous fleet orchestration, Petri Nets provide a rigorous framework for modeling agent behaviors, resource contention (like shared pathways or workstations), and communication protocols. They are particularly powerful for deadlock detection, as structural analysis of the net can reveal siphons and traps—substructures that indicate potential for global system blockage. By analyzing the reachability graph of all possible markings, engineers can formally verify properties like liveness (no deadlock) and boundedness (no resource overflow), ensuring the designed multi-agent system is free from pathological gridlock before deployment.
Core Components of a Petri Net
A Petri Net is a bipartite directed graph composed of four fundamental elements that formally model the state and flow of a concurrent, distributed system. Its structure is used to analyze properties like liveness, boundedness, and deadlock.
Places
Places (represented as circles) model passive system components that can hold discrete tokens. They represent conditions, resources, buffers, or states in the system.
- A place's marking is the number of tokens it currently contains.
- The distribution of tokens across all places defines the global state or marking of the entire Petri Net.
- In a warehouse model, a place could represent a loading dock, a storage bin, or the idle state of a robot.
Transitions
Transitions (represented as bars or rectangles) model active events, actions, or processing steps. They represent the firing of an event that changes the system state.
- A transition is enabled if all its input places contain at least the required number of tokens (as defined by the arc weights).
- When an enabled transition fires, it consumes tokens from its input places and produces tokens in its output places.
- In a workflow, a transition could model start task, complete assembly, or release resource.
Tokens
Tokens (represented as dots or numbers within places) are the dynamic, movable units of the model. They represent the objects or information that flow through the system, such as jobs, data packets, resources, or agents.
- The movement of tokens, driven by transition firings, simulates the system's dynamic behavior.
- The presence of a token in a place signifies that the condition represented by that place is true or that the resource is available.
- In multi-agent orchestration, a token can represent a single autonomous mobile robot (AMR) or a task order.
Arcs
Arcs (directed edges) define the flow relationship between places and transitions. They specify the preconditions for an event and its consequences.
- An arc from a place to a transition is an input arc. It defines which tokens must be present to enable the transition.
- An arc from a transition to a place is an output arc. It defines where new tokens are created when the transition fires.
- Arc weight (an integer, default 1) specifies how many tokens are consumed or produced per firing.
- Arcs cannot connect two places or two transitions directly, enforcing the bipartite graph structure.
Marking (State)
The marking is a snapshot of the entire system's state at a given moment, defined as a vector or multiset specifying the number of tokens in each place.
- The initial marking (M₀) is the starting state of the system.
- The state space or reachability set is the set of all possible markings reachable from the initial marking through any sequence of legal transition firings.
- Analyzing the reachability graph is fundamental for verifying system properties. For deadlock detection, analysts search for a marking where no transition is enabled, halting all progress.
Analysis for Deadlock
Petri Nets provide formal techniques to analyze deadlock, a critical concern in fleet orchestration.
- Structural Analysis: Examines the net's graph for siphons (sets of places that, once emptied of tokens, can never regain them) and traps (sets of places that, once marked, remain marked). An empty siphon often corresponds to a deadlock.
- Reachability Analysis: Constructs the reachability graph to find dead markings where no transitions are enabled. This is a definitive but computationally expensive method for deadlock detection.
- Invariant Analysis: Uses P-invariants (place invariants) to find sets of places whose weighted token sum remains constant, and T-invariants (transition invariants) to identify possible firing sequences that return the net to its original marking, aiding in liveness verification.
How Petri Nets Work and Analyze Systems
A Petri Net is a formal, graphical, and mathematical modeling language used to describe and analyze distributed, concurrent, and asynchronous systems.
A Petri Net is a bipartite directed graph consisting of places (circles, representing states or conditions), transitions (rectangles, representing events or actions), and directed arcs connecting them. The system state, called a marking, is defined by the distribution of tokens (dots) across places. A transition is enabled when all its input places contain at least one token; firing it consumes tokens from inputs and produces tokens in outputs, modeling state change.
Analysis focuses on structural and behavioral properties. Reachability determines if a marking is possible. Liveness ensures no transition can become permanently unfireable. Boundedness verifies token counts remain finite, preventing overflow. For deadlock analysis, a marking where no transition is enabled represents a global deadlock. Invariant analysis examines weighted sums of tokens that remain constant, proving system safety properties independent of execution sequence.
Examples and Use Cases
Petri Nets provide a formal, graphical language for modeling and analyzing concurrent, asynchronous systems. Their primary utility lies in verifying critical properties like deadlock freedom, liveness, and boundedness before system deployment.
Manufacturing & Workflow Automation
Petri Nets are extensively used to model and optimize discrete manufacturing systems and business processes. They can represent:
- Production lines with parallel assembly stations.
- Resource contention for machines, tools, or workers.
- Buffer capacities between process stages.
By analyzing the net's reachability graph, engineers can identify bottlenecks, ensure the system is deadlock-free, and verify that workflows can always complete (liveness). This is foundational for designing flexible, software-defined manufacturing cells.
Communication Protocol Verification
Network and communication protocols are classic applications for Petri Net analysis. They model:
- Message sequencing and handshake mechanisms (e.g., TCP).
- Mutual exclusion in channel access.
- Buffer overflows in router queues.
The formal semantics of Petri Nets allow for exhaustive state-space exploration via model checking. This can prove that a protocol design is free from unspecified receptions, deadlocks, and livelocks, ensuring reliable data exchange in distributed systems.
Multi-Agent System Coordination
In heterogeneous fleet orchestration, Petri Nets model the concurrent behavior of multiple agents (AMRs, AGVs, manual vehicles) sharing a workspace. Key modeling aspects include:
- Agent states (idle, traveling, loading) as places.
- Zone occupancy and access rules as tokens.
- Task initiation/completion and resource claims as transitions.
Analyzing the net can proactively detect potential deadlocks arising from circular waits for shared pathways, charging stations, or loading docks, enabling the design of robust zone management and priority-based routing protocols.
Hardware & Digital Circuit Design
Petri Nets, particularly Signal Transition Graphs (STGs), model asynchronous digital circuits. They capture:
- Causality and concurrency between signal transitions.
- Circuit hazards like glitches or critical races.
- Interface protocols between hardware components.
Formal analysis verifies that the circuit is speed-independent (correct regardless of gate delays) and deadlock-free. This is crucial for designing reliable control logic, arbiters, and self-timed systems where global clock signals are absent or impractical.
Software Concurrent Process Analysis
Petri Nets model the synchronization of concurrent software processes or threads. They are used to analyze:
- Semaphore and mutex operations.
- Producer-consumer problems with bounded buffers.
- Dining philosophers and other classic synchronization problems.
The structural analysis of the net (e.g., finding P-invariants and T-invariants) can prove properties like the boundness of a buffer (preventing overflow) or the fairness of resource allocation, helping to eliminate race conditions and deadlocks in multi-threaded application design.
Formal Analysis & Verification Tools
The theoretical foundation of Petri Nets enables rigorous analysis through dedicated software tools. Common analyses include:
- Reachability Analysis: Exploring all possible markings (system states).
- Invariant Analysis: Using linear algebra to find place invariants (token conservation) and transition invariants (cyclic behavior).
- Model Checking: Using tools like CPN Tools, PIPE, or LoLA to verify temporal logic properties (e.g., "it is always possible to return to the initial state").
These tools allow systems architects to mathematically verify safety (nothing bad happens) and liveness (something good eventually happens) properties before implementation.
Petri Nets vs. Other Modeling Techniques
A comparison of formal modeling languages and techniques used to analyze concurrency, synchronization, and deadlock in distributed and multi-agent systems.
| Feature / Aspect | Petri Nets | Finite State Machines (FSMs) | UML Activity Diagrams | Resource Allocation Graphs (RAGs) |
|---|---|---|---|---|
Primary Modeling Paradigm | Concurrency & distributed state | Sequential state transitions | Workflow & control flow | Resource dependencies |
Formal Mathematical Foundation | ||||
Native Support for Concurrency | ||||
Explicit Resource Modeling (Tokens/Places) | ||||
Deadlock Detection via Structural Analysis | ||||
Ability to Model Synchronization (e.g., rendezvous) | ||||
State Space Explosion Problem | ||||
Direct Mapping to Wait-For Graph (WFG) | ||||
Tool Support for Automated Analysis (e.g., model checking) | ||||
Suitability for Dynamic Fleet Orchestration |
Frequently Asked Questions
A Petri Net is a formal, mathematical modeling language used to describe and analyze distributed, concurrent systems. It provides a graphical and analytical framework for studying properties like synchronization, resource sharing, and deadlock.
A Petri Net is a bipartite directed graph consisting of places (drawn as circles), transitions (drawn as bars or rectangles), and directed arcs connecting them, which models the dynamic behavior of a concurrent system using a flow of tokens (drawn as dots within places). It works by defining a system's state as a marking—a distribution of tokens across places—where a transition is enabled to fire if all its input places contain at least one token; firing consumes tokens from input places and produces tokens in output places, representing a state change, event, or action in the modeled system.
Key Components:
- Places: Represent conditions, resources, or buffers.
- Transitions: Represent events, actions, or processors.
- Tokens: Represent the truth of a condition, availability of a resource, or data items.
- Arcs: Define pre-conditions (from places to transitions) and post-conditions (from transitions to places).
- Marking: The current state, defined as a vector
M(p)specifying the number of tokens in each placep.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Petri Nets are a foundational formalism for modeling concurrent systems. The following concepts are essential for analyzing and resolving the deadlock scenarios they can represent.
Deadlock
A deadlock is a state in a concurrent system where a set of processes or agents are each waiting for a resource held by another, forming a circular chain of dependencies that prevents any progress. In a Petri Net, a deadlock is represented by a marking (token distribution) from which no transition (event) can fire.
- Four Necessary Conditions: Mutual exclusion, hold and wait, no preemption, and circular wait.
- Petri Net Analysis: Deadlocks correspond to terminal markings or siphons that become unmarked, halting the entire net's execution.
Resource Allocation Graph (RAG)
A Resource Allocation Graph (RAG) is a directed bipartite graph used to model the state of resource allocation and pending requests in a system. It is a simpler, more specialized modeling tool compared to the more general Petri Net.
- Structure: Uses circles for processes, squares for resources, request edges (process → resource), and assignment edges (resource → process).
- Deadlock Indication: A cycle in a RAG where all resources have a single instance is a necessary and sufficient condition for deadlock.
- Relation to Petri Nets: A RAG can be directly mapped to a Place/Transition Net, where places represent resources and conditions, and transitions represent allocation and release events.
Wait-For Graph (WFG)
A Wait-For Graph (WFG) is a directed graph that models dependencies between processes or agents, where an edge from process P_i to P_j indicates P_i is waiting for a resource held by P_j. It is a condensed view used primarily for deadlock detection.
- Derivation: Often derived from a Resource Allocation Graph (RAG) by collapsing resource nodes.
- Cycle Detection: The presence of a cycle in a WFG is equivalent to a deadlock.
- Algorithmic Use: Forms the basis for distributed detection algorithms like edge-chasing, where probe messages traverse the graph to find cycles.
Banker's Algorithm
The Banker's Algorithm is a classic deadlock avoidance algorithm that simulates resource allocation to determine if a system will remain in a safe state. It prevents deadlock by only granting requests that lead to safe states.
- Core Concept: Models the system with available resources, maximum demand per process, and current allocation.
- Safety Algorithm: Searches for a safe sequence of processes that can finish with available resources.
- Contrast with Petri Nets: While the Banker's Algorithm is a runtime policy for a specific resource model, Petri Nets provide a formal modeling language to describe the system state and verify safety properties like deadlock freedom through structural analysis.
Livelock
A livelock is a state where two or more processes continuously change their state in response to each other without making any actual progress. Unlike a deadlock where processes are blocked, livelocked processes are active but stuck in a non-productive loop.
- Analogy: Two people meeting in a hallway, each stepping aside to let the other pass, but mirroring each other's movements and never proceeding.
- Petri Net Representation: Can be modeled as a cycle of firing transitions that does not advance the overall system state toward completion.
- Detection: Requires analysis of liveness properties in the Petri Net, ensuring that desired system states remain reachable.
Model Checking
Model checking is a formal verification technique that exhaustively explores the state space of a concurrent system to prove or disprove properties like deadlock freedom, liveness, and safety. Petri Nets are a common input formalism for model checkers.
- Process: A model checker takes a system model (e.g., a Petri Net) and a specification (e.g., "a deadlock state is never reached") and checks all possible executions.
- State Space Explosion: The primary challenge, as the number of possible states grows exponentially with system complexity.
- Tools: Industrial-strength model checkers like SPIN or CPN Tools can analyze Petri Net models to automatically identify deadlock markings and provide counter-example traces.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us