Fact-checked by Grok 2 weeks ago

Hierarchical task network

A Hierarchical Task Network (HTN) is a paradigm in that represents problems as hierarchical decompositions of tasks into subtasks, using domain-specific methods to guide the process and generate plans from high-level goals. HTN originated in the mid-1970s with early systems like , which introduced the concept of hierarchical decomposition to address the limitations of flat, state-based approaches such as STRIPS. Subsequent developments included Nonlin in 1976, which refined task ordering and constraints, and SIPE in 1984, which incorporated execution monitoring and replanning capabilities. By the , formal theoretical foundations were established, including sound and complete algorithms like the UMCP procedure, which ensures that generated plans achieve the desired task network under all possible world models. Modern HTN planners, such as SHOP2 (introduced in 2003) and its extensions, continue to evolve, integrating with other techniques like probabilistic reasoning for real-time applications. At its core, HTN planning relies on three primary components: primitive tasks, which are basic actions (operators) with preconditions and effects that directly modify the world state; compound tasks, which are abstract goals requiring ; and methods, which specify how to break down compound tasks into networks of subtasks while respecting ordering constraints and causal links. The begins with an initial task network representing the problem and iteratively applies methods to refine non-primitive tasks until only primitive tasks remain, forming a totally ordered or partially ordered plan. This hierarchical structure distinguishes HTN from classical by leveraging expert knowledge to prune the search space, avoiding the common in goal-oriented methods. HTN planning offers significant advantages in scalability and efficiency for domains with inherent hierarchies, such as , , and composition, where it outperforms general-purpose planners by producing plans orders of magnitude faster. Notable applications include the O-PLAN system for mission control, SIPE-2 for military operations planning, and SHOP2 for automated orchestration. Despite its strengths, HTN requires substantial upfront domain modeling, which can limit its applicability in highly dynamic or unknown environments.

Introduction

Definition and Overview

Hierarchical Task Network (HTN) planning is an technique for automated that decomposes high-level tasks into a of subtasks using predefined methods, continuing this process until primitive actions—executable operations in the domain—are reached. This approach structures planning around task networks, where complex objectives are broken down systematically to generate feasible plans. Unlike state-search methods that explore states to achieve goals, HTN planning relies heavily on domain-specific encoded in hierarchical structures, such as methods that specify how to refine abstract tasks into concrete ones. The outcome is typically a partially or totally ordered sequence of tasks that satisfies the constraints of the task network, enabling execution in dynamic environments. Originating in the 1970s with early systems like , HTN incorporates basic task types—, , and goal tasks—as foundational elements for this decomposition. HTN planning offers greater expressiveness than classical planning frameworks like STRIPS or PDDL, natively supporting partial orders, temporal constraints, and domain hierarchies without requiring exhaustive state enumeration. However, this expressiveness comes at the cost of potential undecidability in unrestricted domains, necessitating constraints for practical solvability. Compared to classical planning's goal-driven, search-intensive paradigm, HTN is more knowledge-driven, promoting scalability in complex, structured domains like and composition by leveraging expert-provided hierarchies.

Historical Development

The origins of Hierarchical Task Network (HTN) planning trace back to the mid-1970s, when early systems sought to address limitations in linear planning approaches by incorporating hierarchy and partial ordering of actions. The planner, developed by Sacerdoti in 1975, introduced the concept of hierarchical decomposition in , representing plans as networks of action hierarchies to manage complex interactions more efficiently than totally ordered sequences. Building directly on , Austin Tate's Nonlin system, released in 1976, refined these ideas by modeling plans as hierarchical partial-order networks, allowing for greater flexibility in handling nonlinear dependencies and choice points during decomposition. In the and , HTN evolved through systems that enhanced handling, executability , and expressiveness. David Wilkins' SIPE, first designed in 1983 and extended into SIPE-2 by 1990, incorporated hierarchical task decomposition with support for and resource management, enabling more practical applications in domains like military operations. The O-Plan system, developed by Keith Currie and Austin Tate in the early , advanced open architectures for HTN , emphasizing modularity and integration with execution monitoring. Concurrently, the UMCP framework at the University of Maryland, formalized by Kutluhan Erol, James Hendler, and Dana Nau in 1994, provided the first sound and complete procedure for HTN , establishing a rigorous syntax and semantics that proved the approach's theoretical foundations. The late 1990s and 2000s saw influential HTN systems like and SHOP2, which prioritized ordered task decomposition for efficiency. Introduced by Dana Nau and colleagues in 1999, demonstrated strong performance in domain-independent planning by generating executable plans in execution order, though it faced controversy when disqualified from the International Planning Competition () due to non-standard assumptions about task ordering. SHOP2, extended in 2003, further improved metric and temporal reasoning, earning recognition in the 2002 for its domain-independent capabilities. A 2015 overview by Marco Manna and Federico Pecora synthesized earlier HTN developments, highlighting its comparison to other planning paradigms. Advancements from 2020 to 2025, as of November 2025, have focused on integrating HTN with for automated method learning from traces and paradigms for dynamic environments. For instance, extensions building on derivatives have enabled via preferences, while HTN with partial-order causal-link has enhanced scalability in multi-agent and scenarios. The 2020 IPC introduced a dedicated HTN track using the HDDL , fostering standardized benchmarks. Recent research includes plan repair algorithms like SHOPFixer and IPyHOPPER (2024) and Optimization enhancements for refinement (2025), alongside ongoing workshops such as HPlan 2025.

Core Concepts

Tasks and Task Networks

In Hierarchical Task Network (HTN) planning, tasks serve as the fundamental units of and execution. Primitive tasks represent basic, executable actions that directly modify the world state, typically defined with preconditions that must hold for execution and effects that describe the resulting changes, analogous to operators in STRIPS-style . Compound tasks, in contrast, are abstract constructs that cannot be executed directly but must be decomposed into sequences of subtasks, enabling hierarchical refinement of complex activities. Goal tasks specify desired state conditions to achieve, such as achieving a particular literal in the planning domain, and are often used to initiate the process by representing high-level objectives. A task network in HTN planning is a structured collection of tasks interconnected by constraints that enforce causal and temporal relationships, formally represented as a pair consisting of a set of tasks and a set of ordering constraints, such as precedence links (e.g., one task must precede another) or inequalities to prevent interleaving where necessary. These networks begin with an initial task, often a compound or goal task, and evolve through decomposition until only primitive tasks remain, forming a solvable plan. Causal constraints ensure that the effects of earlier tasks support the preconditions of later ones, while temporal constraints manage the sequence and potential parallelism of subtasks. HTN planning supports different decomposition styles for task networks, which determine how ordering is handled during refinement. In totally ordered task decomposition (TOTD), subtasks are fully sequenced in a linear order, simplifying planning but limiting opportunities for concurrency, as seen in early systems like . Unordered task decomposition (UTD) relaxes this by allowing subtasks to be interleaved without enforced parallelism, enabling more flexible refinement while maintaining sequential execution. Partially ordered task decomposition (POTD) provides the most expressiveness, permitting partial orders where compatible subtasks can execute in parallel, subject to constraints, as implemented in planners like SHOP2. Constraints within task networks play a crucial role in facilitating efficient by enabling parallelism among subtasks, managing shared resources to prevent overuse, and detecting potential conflicts such as deleted preconditions from interfering actions. For instance, in a network for assembling a , the compound task "assemble robot" might decompose into subtasks "fetch parts" (a compound task further breaking into actions like "pick up arm" and "pick up leg") and "connect components" (primitive tasks such as "attach arm" and "attach leg"), with precedence constraints ensuring parts are fetched before connection to avoid resource conflicts. This structure supports scalable in domains requiring coordinated, multi-step processes.

Methods and Operators

In Hierarchical Task Network (HTN) planning, operators serve as the foundational elements for executing actions that directly alter the world state. An operator is formally defined as a (p(o), \pre(o), \eff(o)), where p(o) denotes the primitive task, \pre(o) specifies the preconditions that must hold in the current state for the to be applicable, and \eff(o) captures the effects, typically partitioned into add effects (new facts added to the state) and delete effects (facts removed from the state). This structure draws from classical operators but is integrated into HTN domains to ground higher-level decompositions in executable actions. Methods, in contrast, provide the for decomposing non-primitive (compound) tasks into simpler subtasks, enabling hierarchical refinement. A is typically represented as a pair (\alpha, d), where \alpha is the non-primitive task to be decomposed, and d is a subtask network consisting of ordered or partially ordered subtasks along with supporting constraints. Methods often include multiple alternatives to handle variability in ; for instance, a single compound task might have several methods, each offering a different decomposition path chosen based on contextual fit. These decompositions are encoded declaratively to reflect expert knowledge, allowing HTN planners to efficiently generate plans without exhaustive search in familiar domains. Preconditions for methods ensure that a decomposition is applicable only under suitable conditions, enhancing the precision of task refinement. These preconditions can reference the world state (e.g., requiring specific facts like the availability of resources) or conditions on the task network itself (e.g., ordering constraints between subtasks or variable bindings to avoid conflicts). For example, a method's applicability might demand that the current state satisfies a of literals, or that the enclosing task network maintains causal or temporal consistency among its components. This dual nature of preconditions—state-based and network-based—allows methods to adapt flexibly while preserving plan validity during . HTN planning employs strategies to manage decisions about task ordering and bindings during , balancing flexibility and efficiency. In the least- strategy, decisions such as ordering subtasks or instantiating s are delayed until necessary, often using partial orders to represent multiple possible linearizations and avoiding premature choices that could lead to dead ends. Conversely, the early- strategy binds s and enforces total orders immediately upon method application, which can prune search space early but risks over-constraining the plan in complex domains. Empirical studies have compared different strategies, showing varying performance depending on the domain. An illustrative example is the "" method for moving from x to y. If the \mathrm{short\text{-}distance}(x, y) holds (a world-state ), the method decomposes into the subtask network \langle \[drive](/page/Drive)(x, y) \rangle, invoking the with its own preconditions (e.g., vehicle availability) and effects (e.g., adding "at(y)" and deleting "at(x)"). For longer distances where \mathrm{long\text{-}distance}(x, y) holds, an alternative applies, decomposing into \langle \[travel](/page/Travel)(x, \[airport](/page/Airport)(x)), \[fly](/page/Fly)(\[airport](/page/Airport)(x), \[airport](/page/Airport)(y)), \[travel](/page/Travel)(\[airport](/page/Airport)(y), y) \rangle, with preconditions ensuring access and integrating these subtasks into the broader task network for complete plan execution.

Formal Model

Plan-Based HTN

Plan-based hierarchical task network (HTN) planning formalizes the problem as a (Q, T_p, T_c, O, M, tn_0, s_0), where Q is a of predicate symbols defining the , T_p is the set of task symbols, T_c is the set of (non-) task symbols, O is a of operators each specifying preconditions and effects for a primitive task in T_p, M is a of methods each providing a for a compound task in T_c into a subtask network, tn_0 is the initial task network, and s_0 is the initial world represented as a set of atoms over Q. This formulation, rooted in early HTN semantics, emphasizes encoded in methods and operators to guide without relying on goal regression or forward search typical of classical . In this model, planning proceeds as a refinement process on task networks, starting from tn_0—a of tasks with associated constraints—and iteratively selecting a compound task to decompose using an applicable method from M, replacing it with the method's subtask network while preserving consistency with existing constraints and the initial state s_0. The process continues nondeterministically until the network contains only primitive tasks, whose execution sequence must be valid given s_0 and the operators in O, yielding a totally ordered . Task networks themselves are triples (T, l, \psi), with T the set of tasks, l a labeling function assigning task symbols, and \psi capturing constraints like causal links, variable bindings, and temporal orderings to manage dependencies. The search space for plan-based HTN is conceptualized as a PG, where each is a valid task network and each edge represents either a application (decomposing a compound task) or an ordering refinement (imposing additional constraints to resolve ambiguities in \psi). This graph is explored from the root tn_0, with paths leading to leaf nodes consisting solely of primitive tasks; the planning problem reduces to finding a path to a executable network whose primitives form a valid plan in the state space induced by s_0 and O. Task interactions in plan-based HTN are handled through the constraint system \psi: harmful interactions, such as those causing precondition deletions or between subtasks, are detected and resolved by posting ordering or binding constraints to prevent conflicts during refinement. Conversely, helpful interactions—where one task supports another's —are leveraged to enable parallelism, allowing non-conflicting subtasks to be scheduled concurrently within the partial order, thus reducing plan length and improving efficiency without explicit state simulation. The and of plan-based HTN are established for the that exhaustively explores the refinement , provided decidable restrictions hold, such as acyclic to prevent refinement chains and finite axioms ensuring a bounded search space. Under these conditions, the algorithm generates only executable plans that achieve the semantics of tn_0 from s_0, and it terminates with failure if no such plan exists. In contrast to -based HTN models, which incorporate progression checks during each step, plan-based HTN defers validation until the final primitive , prioritizing structural over incremental world updates.

State-Based HTN

State-based HTN extends the hierarchical task network by explicitly incorporating world progression into the process, allowing for dynamic interaction between task and transitions. Formally, a state-based HTN problem is defined as a (Q, T_p, T_c, O, M, tn_0, s_0), where Q is a finite set of symbols defining the , T_p is the set of primitive task symbols, T_c is the set of compound task symbols, O is the set of operators representing primitive tasks, M is the set of methods for decomposing compound tasks, tn_0 is the initial task network, and s_0 is the initial world . Unlike purely abstract decompositions, this model simulates changes after the execution of each primitive task, enabling preconditions for methods and operators to be evaluated against the current before application. For instance, in the SHOP2 planner, methods are applicable only if their preconditions hold in the current , ensuring that decompositions reflect executable sequences. The search space in state-based HTN consists of pairs (s, tn), where s is a world and tn is a partially or totally ordered task network; decomposition of a compound task occurs only when its preconditions are satisfied in s, and primitive tasks transition to a successor s' via their effects. This state-task integration contrasts with plan-based HTN, which refines task networks in an abstract space without simulating state changes during , often allowing more flexible partial orderings. In state-based approaches, total ordering is frequently enforced through early commitment strategies, making them particularly suitable for with execution-time sensing—via external computations or observations—or non-deterministic effects, which are handled through over possible outcomes. Planners like SHOP2 exemplify this by supporting sensing actions that query the mid-planning. Regarding expressiveness, state-based HTN better accommodates conditional effects by evaluating them against the evolving during and supports domain axioms for derived predicates, enhancing its ability to model complex dependencies. However, this integration results in a potentially larger search space, as the planner explores transitions alongside task refinements, increasing computational demands compared to the more compact abstract search in plan-based HTN. A solution to a -based HTN problem is a sequence of -task pairs (s_0, tn_0), (s_1, tn_1), \dots, (s_n, tn_n) such that tn_n contains only executable tasks, the final s_n satisfies the , and each transition adheres to applicable methods or operators. This formalization has proven effective in domains requiring adaptation, such as robotic control with uncertain sensors.

Planning Algorithms

Decomposition Process

The decomposition process in Hierarchical Task Network (HTN) is a recursive that transforms an initial task network into a fully plan consisting of tasks. It begins by identifying a non-primitive () task within the current network and selecting an applicable to decompose it into a subtask network. This is chosen based on unification with the task's and of its preconditions in the current . The task is then replaced by the subtask network specified in the , which may include both and subtasks, along with any associated ordering constraints or conditions. Constraints from the parent network, such as task orderings or causal links, are propagated to the new subtasks to maintain consistency. When multiple are applicable to a given compound task, the process handles selection through domain-specific heuristics, such as ordered preferences in the method definitions or a "first applicable" strategy in deterministic planners. In ordered-task- variants, methods are prioritized by their declaration order, ensuring a linear progression without during pure decomposition. This approach avoids exhaustive search in simple cases but can integrate with search mechanisms for nondeterministic domains where multiple viable decompositions exist. During , constraints are resolved iteratively to ensure the resulting is valid and . Ordering constraints (e.g., precedence relations between subtasks) are enforced by propagating them from the method's to the overall . Causal links, which connect task effects to subsequent preconditions, are established or verified to prevent inconsistencies, while resource conflicts—such as overlapping temporal or capacity requirements—are addressed through critic functions that refine the by adding resolutions or flagging infeasibilities. In partially ordered HTN, these critics nondeterministically generate alternative to satisfy constraints without altering the domain semantics. The process terminates when the task network contains only primitive tasks and all constraints are satisfied, meaning preconditions can be met in a feasible execution sequence without unresolved conflicts. At this point, the primitive tasks form an executable plan, which can be verified against the initial state. If decomposition fails due to unresolvable constraints or lack of applicable methods, the process backtracks or reports failure, though in non-search versions, it halts immediately. A basic outline of the non-search HTN decomposition algorithm, inspired by the UMCP planner, can be expressed in pseudocode as follows:
function Decompose([Network](/page/Network) d, [State](/page/State) I, [Domain](/page/Domain) D):
    if d contains only primitive tasks:
        if ResolveConflicts(d, I, D) succeeds:
            return d as [plan](/page/Plan)
        else:
            return failure
    
    select a compound task t in d  // e.g., leftmost or heuristic-based
    for each applicable [method](/page/Method) m for t in D:  // check preconditions and unification
        subnetwork n = m's task network
        new_d = reduce(d, t, n)  // replace t with n, propagate constraints
        apply critics τ(new_d, I, D)  // generate refined networks, resolve orderings/causal links
        for each refined network d' in τ's output:
            result = Decompose(d', I, D)
            if result ≠ failure:
                return result
    return failure
This recursive procedure ensures systematic refinement until a primitive emerges, with critics handling at each level.

Search Strategies

In Hierarchical Task Network (HTN) planning, the primary search strategy employed by many planners is (DFS), which efficiently explores the hierarchical decomposition space by committing to one branch of task refinements at a time until a complete plan is found or occurs. This approach is particularly suited to the structured nature of HTN domains, where methods guide the search along promising paths, reducing the compared to flat state-space search. For instance, the SHOP2 planner implements DFS via depth-first to handle nondeterministic choices in task decomposition and operator application, enabling rapid plan generation in ordered task networks. Alternative strategies include (BFS), which is used in planners like Nonlin to ensure optimality by exploring all possible decompositions level by level, though it is typically limited to small domains due to its exponential memory requirements. Best-first search variants, guided by heuristics such as relaxed planning graphs, have been developed to balance efficiency and quality; these relax delete effects or ordering constraints to estimate decomposition costs, as explored in delete-relaxation heuristics that approximate the impact of task networks on the state space. Forward search predominates in state-based HTN planners like SHOP2 and SIADEX, starting from the initial task network or state and progressing through successive refinements toward primitive actions. Backward search, which begins from goal tasks and regresses to the initial state, is less common but appears in some plan-based systems, leveraging partial-order reductions without explicit state tracking. General HTN planning is undecidable, as proven by reduction to problems like language equivalence for context-free grammars, but decidable fragments are achieved through restrictions such as acyclic method hierarchies (no loops) or bounded decomposition depth to ensure termination. The computational complexity of plan existence in these fragments ranges from NP-complete for primitive-task networks to EXPSPACE-complete for regular (partially ordered) networks with variables. Extensions to core search strategies include integration with sensing actions in execute-and-sense frameworks, where planners like SIADEX interleave with runtime observations to handle partial observability during plan execution. Additionally, preferences can be incorporated into best-first or branch-and-bound searches for optimal plans, as in SHOP2's support for cost-based variable sorting and optimization criteria to select among multiple valid . In practice, these strategies contribute to SHOP2's strong performance in domains like International Planning Competition , where DFS with heuristics often outperforms unguided alternatives. Recent developments include optimized total-order forward in planners like , which won the 2020 HTN track, enhancements using optimization for method selection, advanced plan repair techniques such as SHOPFixer and IPyHOPPER, and integrations with large language models to assist in hierarchical as of 2025.

Implementations

Notable HTN Planners

SHOP2 is a plan-based Hierarchical Task Network (HTN) planner that employs with support for axioms and conditional effects, enabling efficient handling of temporal and metric planning problems. Developed in 2003, SHOP2 demonstrated strong performance in the (IPC) and has been applied to composition, where it translates OWL-S descriptions into executable plans. As an open-source system, SHOP2 has influenced subsequent HTN implementations by providing a robust for ordered task decomposition. SIPE-2, developed in the and by David Wilkins, is a state-based HTN planner that incorporates hierarchical constraints, resource reasoning, and execution monitoring to support dynamic plan adjustment during runtime. It builds on techniques from its predecessor SIPE, allowing for flexible constraint management in complex environments. SIPE-2 has been notably applied in domains, where its ability to integrate with reactive facilitates real-world deployment. O-Plan2, emerging in the , represents a plan-based HTN planner that emphasizes constraint-based with integrated timeline reasoning to manage temporal dependencies and . It features an for command, , and , supporting over 15 domains including and scheduling tasks. O-Plan2's contributions lie in its practical applicability, making it one of the most widely used HTN systems for real-world operations. PANDA, introduced in the , is a partial-order HTN planner that compiles HTN problems into PDDL for enhanced expressiveness and interoperability with classical tools. The system supports both totally ordered and partially ordered models, with recent extensions like the PANDA Progression System winning the total-order tracks in the 2023 . By focusing on planning techniques that combine HTN decomposition with partial-order causal links, PANDA advances the scalability of hierarchical planning in diverse domains. In the 2020s, HTNPlan-P extends traditional HTN planning to probabilistic settings, generating high-quality contingent plans by integrating user preferences and branch-and-bound search as an enhancement to SHOP2. Learning extensions, such as those that automatically derive HTN methods from plan traces, further augment these systems by reducing manual domain engineering. Emerging research also explores integrations with large language models for automated domain modeling and plan generation. Techniques for compiling HTN domains to PDDL enable seamless integration with non-hierarchical planners, improving performance through restricted translations that preserve hierarchical structure. Early HTN systems like laid foundational groundwork for these developments by introducing task networks in the .

Example Domains

Hierarchical task network (HTN) planning is often illustrated through benchmark domains that demonstrate task decomposition and constraint handling in structured environments. These examples highlight how abstract tasks are broken down into primitive actions while respecting domain-specific constraints, such as physical stacking or multi-modal transport. Common domains include , , and web service composition, which showcase HTN's applicability to , transportation, and orchestration tasks, respectively. In the Blocks World domain, the environment consists of blocks on a table that can be moved by a robotic arm, with the goal typically involving stacking configurations. A compound task like "build tower" (e.g., stacking blocks A on B and B on C) decomposes hierarchically: the method for "build tower(n blocks)" requires first achieving "build tower(n-1 blocks)" as a subtask, then unstacking the nth block if necessary, moving it to the table, and finally stacking it atop the partial tower, subject to constraints ensuring the target block is clear and the arm is free. This recursive decomposition enforces stacking order and avoids invalid moves, such as placing a block on an occupied surface, producing a linear plan of primitive "pickup" and "putdown" actions. Primitive operators include "unstack(block, from)" and "stack(block, onto)", with preconditions like "clear(block)" and effects updating spatial relations. The Logistics domain models package transportation across cities using trucks, planes, and airports, emphasizing multi-modal coordination. The high-level task "transport package from city1 to city2" decomposes via methods that select transport modes based on distance and availability: for short distances, a truck method sequences "load package onto truck," "drive truck to destination," and "unload package"; for long distances, it chains to an airplane method involving "drive to airport," "load onto plane," "fly plane," and "drive from destination airport," with constraints ensuring vehicle capacity, fuel, and location matching (e.g., package and vehicle must be co-located for loading). This handles interleaved subtasks, such as multiple packages sharing a flight, and produces a plan of primitives like "load(truck, package, city)" and "fly(plane, city1, city2)". Web service composition applies HTN to orchestrate online services, such as "book trip" decomposing into "search flights," "reserve ," and "book " with quality-of-service (QoS) constraints like cost or timing. In OWL-S-based frameworks, the top-level task uses methods with preconditions (e.g., > ) to select subtasks: "search flights" invokes services to query , then "reserve" executes services if slots match preferences; similarly decomposes to "check " and "confirm booking," ordered sequentially but with choices for alternatives (e.g., vs. ). Constraints resolve conflicts, such as ensuring flight arrival aligns with , yielding a of invocations like "invoke(flightSearch, origin, destination)". Planners like SHOP2 execute this by translating service descriptions into HTN methods. A step-by-step trace in the domain illustrates : Start with initial task network {travel(UMD, )}. Apply : decompose to {buy-ticket(BWI, ), travel(UMD, BWI), fly(BWI, ), travel(, )}, where BWI and are . Further decompose "travel(UMD, BWI)": since > 2 miles, use taxi yielding {call-taxi(UMD), ride-taxi(UMD, BWI), pay-driver(BWI)}; "buy-ticket" becomes if available. Constraints order subtasks (e.g., buy before fly) and check state (e.g., cash sufficient for ). Continue until all tasks are primitives: final plan is call-taxi(UMD) → ride-taxi(UMD, BWI) → pay-driver(BWI) → buy-ticket(BWI, ) → drive-to-airport(BWI) → load-passenger(plane, BWI) → fly(plane, BWI, ) → ... (unloading at ), resolving location and resource constraints iteratively. Encoding methods and operators for scalability in HTN domains involves defining methods as (task, preconditions, subtask network) tuples, with operators as (name, parameters, preconditions, add/delete lists, optional costs). For efficiency, author methods as "standard operating procedures" that capture domain expertise (e.g., recursive stacking in ), use partial ordering for interleaving (e.g., parallel transports in ), and incorporate numeric fluents or external calls for real-world variability (e.g., QoS in services). Test incrementally on small instances to ensure completeness, avoiding over-specification that limits flexibility. SHOP2's syntax exemplifies this, supporting axioms for derived preconditions.

Applications

Robotics and Automation

Hierarchical task networks (HTNs) have been instrumental in for decomposing complex manipulation tasks into executable sequences, particularly in space exploration applications. For instance, the QuijoteExpress planner employs HTN-based hierarchical timeline networks to manage operations, breaking down high-level tasks like or into sub-tasks such as terrain sensing via camera and adaptive . This integrates sensing to sequence assembly-like activities, such as positioning the rover arm for sample collection while accounting for environmental constraints like soil stability. In industrial automation, HTN planning supports workflows in by handling resource-constrained assembly processes. The O-Plan system, a seminal HTN planner, has been applied to for oil tanker truck assembly, where compound tasks like fabricating vessel components are decomposed using schemas that incorporate temporal and resource constraints, such as material availability and workstation scheduling. This approach ensures feasible plans by verifying preconditions for reusable resources like tools and during the hierarchical refinement of assembly sequences. Hybrid HTN systems enhance robustness in dynamic robotic environments by integrating deliberative planning with reactive behaviors for execution monitoring. A notable example combines HTN for high-level task coordination with behavior trees for low-level reactivity, allowing robots to detect deviations—such as unexpected obstacles—and trigger local adaptations without full replanning, as demonstrated in multi-agent simulations where failure rates dropped significantly compared to pure HTN methods. This hybrid setup facilitates monitoring in unpredictable settings, like exploration robots adjusting to terrain changes during task execution. Advancements in the have extended HTN to service s for everyday tasks, such as , by decomposing them into and grasping primitives. In home service robot applications, an HTN method leverages semantic and probabilistic reasoning to cleaning routines, refining abstract goals like "clean room" into sub-tasks involving path planning to avoid obstacles and targeted grasping of , improving adaptability in cluttered indoor spaces. HTN's scalability in is evident in multi-robot coordination, where partial orders enable actions amid . The T-HTN planner uses timeline-based HTNs with constraints to orchestrate multiple robots, such as coordinating arm movements on shared rails for tasks, while simple temporal networks handle execution variances like delayed sensing, allowing flexible partial orders that maintain overall mission deadlines without rigid sequencing.

Game AI and Simulation

Hierarchical Task Networks (HTNs) have been widely adopted in game to enable non-player characters (NPCs) to pursue complex goals through structured decomposition, allowing for believable and adaptive behaviors in dynamic virtual environments. In strategy games, HTNs facilitate high-level objectives like "defend base," which decompose into subtasks such as patrolling perimeters or engaging threats, as demonstrated in real-time strategy (RTS) akin to StarCraft using the Spring RTS engine, where HTN agents outperformed built-in through efficient and tactical adjustments. This approach contrasts with flat methods by leveraging predefined hierarchies to reduce computational overhead during , enabling real-time decision-making for multiple agents. In commercial video games from the and , HTNs power NPC behaviors in genres like first-person shooters and action RPGs. Similarly, in (2017), HTNs drove robotic enemy hierarchies, allowing adaptive responses to player actions without exhaustive replanning, while in Transformers: Fall of Cybertron (2012), a forward-decomposition HTN planner managed combat sequences for characters like the troll-like "Trunk Thumper," which patrolled, attacked with improvised weapons, and adapted to resource depletion. In RPGs, HTNs support dynamic quest completion by structuring narratives as task hierarchies; for example, a "save ally" quest might decompose into scouting, combat, and retrieval subtasks, with replanning triggered by player interventions like destroying key items, as explored in procedural quest generation systems that solve 32-event quests in under 0.5 seconds. For simulations, particularly in training scenarios, HTNs model coordinated operations in virtual military environments. The SHOP2 planner, an HTN system supporting preferences and partial orders, has been integrated into squad-based simulations like SquadSmart, where it generates collaborative plans for entire units, decomposing missions such as "secure objective" into roles like and , executed in with coordination. In the COMBATXXI , HTNs represent dynamic tactical behaviors, enabling adaptive responses to changes like enemy reinforcements, improving model for purposes over traditional scripted methods. Extensions to HTNs in these domains include learning methods derived from observed behaviors, enhancing adaptability without manual domain engineering. Algorithms like HTN-MAKER learn task-reduction methods from execution traces, applicable to data where expert demonstrations (e.g., player or designer traces) reveal hierarchical structures, as shown in systems that acquire recursive task networks from problem solutions in simulated environments. In game AI, this allows dynamic behavior evolution, such as refining NPC strategies from recorded sessions in RTS games, reducing the need for hardcoded hierarchies. A key advantage of HTNs in entertainment applications is their reusability across varied scenarios, where precomputed or incrementally adjusted plans avoid full replanning, supporting narrative variability and player agency in games like Killzone 3 (2010), where enemy squads reuse modular tactics for diverse combat encounters. This modularity fosters scalable AI that maintains coherence in large-scale simulations, prioritizing efficiency over exhaustive search.

Advantages and Challenges

Strengths

Hierarchical Task Network (HTN) planning offers significant scalability advantages over flat planning approaches, such as those using PDDL without hierarchies, by leveraging a hierarchical decomposition process that prunes the search space in complex domains. This structure guides the planner through abstract tasks before refining them into primitives, reducing the combinatorial explosion inherent in searching all possible action sequences. For instance, in domains like logistics and transportation, HTN planners such as SHOP2 have demonstrated superior runtime performance on large problem instances compared to other HTN planners like UMCP, solving over 100 problems efficiently due to the focused search enabled by domain hierarchies. A key strength lies in HTN's explicit encoding of domain knowledge through methods and task hierarchies, which captures expert insights into how complex tasks decompose, facilitating reuse across similar problems and enhancing plan explainability. Unlike classical planners that rely solely on action preconditions and effects, HTN methods incorporate procedural control knowledge, allowing planners to mirror human-like reasoning and adapt to structured environments with minimal additional search. This knowledge-rich representation has proven effective in over 50 real-world applications, from composition to , where hierarchies promote modularity and transparency in planning. HTN planning supports partial-order task networks, enabling parallelism and flexibility in generation, which outperforms total-order planners in domains involving concurrent actions. By allowing subtasks to execute in when constraints permit, HTN reduces unnecessary sequencing commitments, leading to more efficient in multi-agent or time-sensitive scenarios. Plan-based HTN systems like SIPE-2 and O-Plan2 exemplify this, achieving up to four times faster than total-order counterparts in construction tasks by exploiting partial orders. Empirical performance metrics underscore these benefits, with HTN planners like SHOP2 earning awards for distinguished performance in the 2002 International Planning Competition across hierarchical domains, often solving problems intractable for PDDL-based flat planners. In benchmarks such as the travel domain, while SHOP2 resolved 2 instances compared to 18 for competing systems like SIADEX, its overall performance led to the award. Finally, HTN's integration potential enhances its versatility, as HTN domains can be compiled into PDDL for use with classical planners, combining hierarchical guidance with search. This translation, requiring minimal additional , enables seamless incorporation into broader systems. Moreover, HTN structures are well-suited for learning from demonstrations, where methods can be induced from expert traces to automate in and tasks.

Limitations and Complexity

Hierarchical Task Network (HTN) planning faces fundamental theoretical challenges related to decidability and computational complexity. In its general form, HTN planning is undecidable due to the potential for infinite task decompositions arising from recursive method applications without termination conditions. To address this, practical HTN formalisms impose restrictions, such as finite domain models and acyclic hierarchies, which render planning decidable but still highly complex; for instance, simple HTN problems without axioms are NP-complete, while those incorporating axioms can reach 2-EXPSPACE-completeness. These complexity bounds highlight the inherent difficulty in scaling HTN to arbitrary domains without careful syntactic constraints. A significant practical limitation of HTN planning is the burden of domain authoring, which requires domain experts to encode detailed hierarchical in the form of methods and task networks. This demands a deep understanding of the problem structure, making it more challenging for novices compared to state-based formalisms like PDDL, where goals and actions are specified more declaratively without explicit hierarchies. The need for high-quality, manually crafted methods can lead to substantial engineering effort and errors if the hierarchies do not accurately reflect the 's procedural constraints. HTN planners often exhibit limited optimality, particularly in their default search strategies. Many implementations, such as the planner, rely on (DFS) for efficiency, which produces complete plans but is inherently suboptimal with respect to plan length or cost unless augmented with heuristics or optimization techniques. This approach struggles in domains with very large state spaces, where the hierarchical guidance may not sufficiently prune the search space, leading to inefficient exploration or failure to find shorter plans. Standard HTN planning is primarily designed for deterministic environments and provides weaker support for probabilistic or adversarial settings compared to specialized methods like Markov Decision Processes (MDPs) or Partially Observable MDPs (POMDPs). While extensions exist to incorporate nondeterminism or uncertainty, core HTN formalisms lack native mechanisms for handling transitions or partial observability, limiting their applicability in uncertain or competitive domains. As of 2025, integration of HTN with techniques for automatic hierarchy learning remains limited, with ongoing research primarily exploring hybrid approaches like LLM-assisted method generation rather than fully automated, end-to-end learning systems.

References

  1. [1]
  2. [2]
    [PDF] A Sound and Complete Procedure for Hierarchical Task-Network ...
    One big obstacle to understanding the nature of hierarchical task network (htn) planning has been the lack of a clear theoretical framework. In.
  3. [3]
    [PDF] Hierarchical Task Network (HTN) Planning
    Hierarchical Task Network (HTN) Planning. Section 11.2. Sec. 11.2 – p.1/25. Page 2. Outline. Example. Primitive vs. non-primitive operators. HTN planning ...
  4. [4]
    Hierarchical Task Network - an overview | ScienceDirect Topics
    The Hierarchical Task Network (HTN) paradigm is an approach to automated planning that takes advantage of domain knowledge to reduce the search space.
  5. [5]
    [PDF] Semantics for Hierarchical Task-Network Planning
    In this paper, we present a formal syntax and se- mantics for htn planning. Based on this syntax and semantics, we are able to de ne an algorithm for htn ...
  6. [6]
    [1403.7426] An Overview of Hierarchical Task Network Planning
    Title:An Overview of Hierarchical Task Network Planning ... Abstract:Hierarchies are the most common structure used to understand the world better ...
  7. [7]
    [PDF] The Nonlinear Nature Of Plans - IJCAI
    The planning algorithm of the NOAH system is simple. It expands the most detailed plan in a procedural net by expanding each node of the plan. The nodes are ...Missing: citation | Show results with:citation
  8. [8]
    [PDF] by Austin Tate August 1976 - Artificial Intelligence Applications Institute
    The planner NONLIN generates and keeps for future use any alternatives at choice points. Alternative operator choices, instantiation choices and.
  9. [9]
    [PDF] SHOP: Simple Hierarchical Ordered Planner - IJCAI
    SHOP (Simple Hierarchical Ordered Planner) is a domain-independent HTN planning system with the following characteristics. • SHOP plans for tasks in the ...Missing: 1980s | Show results with:1980s
  10. [10]
    HTN planning: Overview, comparison, and beyond - ScienceDirect
    We propose a framework-based approach where we first provide a basis for defining different formal models of hierarchical planning.Missing: origins | Show results with:origins
  11. [11]
  12. [12]
    [PDF] LEARNING HIERARCHICAL TASK NETWORKS FROM TRACES ...
    Hierarchical Task Network (HTN) planning is one of the most well-known domain- configurable planning paradigms. The most common type of HTN planner does not.Missing: seminal | Show results with:seminal
  13. [13]
    [PDF] International Planning Competition 2020 on Hierarchical Task ...
    The IPC 2020 is a planning competition focused on Hierarchical Task Network (HTN) planning, using HDDL.1 input and a benchmark set for comparison.
  14. [14]
    [PDF] Commitment Strategies in Hierarchical Task Network Planning
    This paper compares three commitment strategies for. HTN planning: (1) a strategy that delays variable bind- ings as much as possible; (2) a strategy in which ...
  15. [15]
    [PDF] Chapter 11 Hierarchical Task Network Planning
    Apr 18, 2012 · # Example: travel to a destination that's far away: ♢ Domain ... Method: air-travel(x,y) travel(a(y),y) get-ticket(a(x),a(y)) travel ...
  16. [16]
  17. [17]
    [PDF] SHOP and M-SHOP: Planning with Ordered Task Decomposition
    1. As ordered-task-decomposition planners, SHOP and M-SHOP require each HTN method to specify a linear ordering for the subtasks, and they ...
  18. [18]
    [PDF] An HTN Planning System - SHOP2 - arXiv
    HTN planning is like classical AI planning in that each state of the world is represented by a set of atoms, and each action corresponds to a deterministic ...
  19. [19]
    [PDF] Delete- and Ordering-Relaxation Heuristics for HTN Planning - IJCAI
    Heuristic search is a common technique to solve HTN planning problems.1 However, the interplay of state-transition and hierarchy makes the design of heuristics ...
  20. [20]
    [PDF] Hierarchical Methods for Optimal Long-Term Planning
    Dec 15, 2011 · ... SIPE (Wilkins, 1983), SIPE-. 2 (Wilkins, 1990), O-PLAN (Drummond and ... nondeterministic planning, and hierarchical task network planning.
  21. [21]
    [PDF] Complexity Results for HTN Planning - by K. Erol, J. Hendler, DS Nau
    (Erol et al., 1992) Erol, K.; Nau, D.; and Subrahmanian, V. S. Complexity, decidability and undecidability results for domain-independent planning. Artificial ...
  22. [22]
    Complexity results for HTN planning | Annals of Mathematics and ...
    Most practical work on AI planning systems during the last fifteen years has been based on Hierarchical Task Network (HTN) decomposition, but until now, ...
  23. [23]
    HTN planning for Web Service composition using SHOP2
    In this paper, we describe how HTN planning system SHOP2 can be used with OWL-S Web Service descriptions. We provide a sound and complete algorithm to translate ...
  24. [24]
    SHOP (Simple Hierarchical Ordered Planner) - UMD CS
    HTN planning is done by problem reduction: the planner recursively decomposes tasks into subtasks, stopping when it reaches primitive tasks that can be ...
  25. [25]
    Can AI planners solve practical problems? - WILKINS - 1990
    With a major new extension, SIPE-2 has begun to address practical problems. This paper describes this new extension and the new applications of the planner.
  26. [26]
    Using the SIPE-2 Planning System: A Manual for SIPE-2
    Hierarchical planning through propositional logic : highly efficient, versatile, and flexible · Upward-Backtracking Mechanism Infused HTN Planning Approach for ...
  27. [27]
    HTN planning | Artificial Intelligence - ACM Digital Library
    2-9. Google Scholar. [51]. I. Georgievski, M. Aiello, An overview of hierarchical task planning. arXiv:1403.7426 CoRR. Google Scholar. [52]. R. Tsuneto, K. Erol ...
  28. [28]
    HTN Planners and their Applications | Download Table
    Particularly, O-Plan2 and SHOP2 are the most practically used planners, while SIPE-2 and SIADEX share the same and relatively high number of applications. ...
  29. [29]
    The PANDA Framework for Hierarchical Planning | KI
    Jan 7, 2021 · This article gives an overview over the PANDA framework, introduces the basic techniques from a high level perspective, and surveys the literature.
  30. [30]
    [PDF] The PANDA Progression System for HTN Planning in the 2023 IPC
    Abstract. The PANDA Progression System is an HTN planning sys- tem that can handle both totally ordered and partially or- dered HTN models.
  31. [31]
    (PDF) The PANDA Framework for Hierarchical Planning
    Hybrid Planning combines Hierarchical Task Network (HTN) planning with concepts known from Partial-Order Causal-Link (POCL) planning. We introduce novel ...<|separator|>
  32. [32]
    Probabilistic contingent planning based on HTN for high-quality plans
    Aug 14, 2023 · In this paper we propose a probabilistic contingent Hierarchical Task Network (HTN) planner, named High-Quality Contingent Planner (HQCP), to generate high- ...
  33. [33]
    [PDF] Translating HTNs to PDDL: A Small Amount of Domain Knowledge ...
    HTN planning knowledge can be translated into PDDL, and even small amounts of this knowledge can greatly improve a classical planner's performance.
  34. [34]
    [PDF] HTN-MAKER: Learning HTNs with Minimal Additional Knowledge ...
    We demonstrate through experiments in three well-known planning domains, namely Logistics, Blocks-World, and Satellite, that HTN-MAKER returns a set of HTN ...
  35. [35]
    [PDF] Control Strategies in HTN Planning: Theory Versus Practice
    To create plans, HTN planning uses task decomposition, in which the planning system decomposes tasks into smaller and smaller subtasks until primitive tasks ...
  36. [36]
    [PDF] HTN Planning for Web Service Composition Using SHOP2
    Jun 22, 2004 · In this paper, we describe how HTN planning system SHOP2 can be used with OWL-S Web Ser- vice descriptions.
  37. [37]
    [PDF] Applications of SHOP and SHOP2 - UMD Computer Science
    Jun 25, 2004 · HTN planning is done by applying HTN methods, which basically are forms that describe how to decompose tasks into subtasks. HTN methods can be ...
  38. [38]
    (PDF) Planning Mars Rovers with Hierarchical Timeline Networks
    One big obstacle to understanding the nature of hierarchical task network (htn) planning has been the lack of a clear theoretical framework. In particular ...
  39. [39]
    [PDF] A Hybrid Approach to Planning and Execution in Dynamic ...
    In this work, we propose a hybrid approach combining an. HTN planner (which is responsible for the coordination of multiple agents) with Behavior Trees. We ...
  40. [40]
  41. [41]
    [PDF] Timeline based HTN Planning for Multi-Agent Systems
    There are multiple ways that they can achieve this task. They can either travel via Amtrak or take a flight or drive to the destination. This simple task can be ...
  42. [42]
    [PDF] A Review of Real-Time Strategy Game AI - AAAI Publications
    Using a balanced strategy, the HTN agent usually beats the built-in AI in. Spring, largely due to better resource management. Efforts to learn HTNs, such as ...<|control11|><|separator|>
  43. [43]
    Hierarchical Task Network (HTN) Planning in AI - GeeksforGeeks
    Jul 23, 2025 · Hierarchical Task Network (HTN) Planning is a powerful approach in Artificial Intelligence (AI) that solves complex planning problems by ...What is Hierarchical Task... · Case Study: HTN Planning in...
  44. [44]
    [RELEASED] Fluid Hierarchical Task Network planner [AI] [FREE]
    Apr 18, 2019 · GitHub - ptrefall/fluid-hierarchical-task-network: A simple HTN planner based around the principles... ... With early reject opportunities and ...Missing: SHOP | Show results with:SHOP<|control11|><|separator|>
  45. [45]
    [PDF] Exploring HTN Planners through Example - Game AI Pro
    In AI development, a common problem to solve is behavior selection. There ... “Semantics for Hierarchical Task-Network. Planning.” Technical report TR 95-9.
  46. [46]
    [PDF] Hierarchical Generation of Dynamic and Nondeterministic Quests
    Nov 14, 2014 · [19] applies Hierarchical Task. Network planning (HTN) to encode strategies to coordinate teams of bots in first-person shooter games. The use ...
  47. [47]
    View of SquadSmart — Hierarchical Planning and Coordinated Plan ...
    ... Hierarchical Task Net-work (HTN) planning to a squad-based military simulation.The hierarchical planner produces collaborative plans for thewhole squad in ...
  48. [48]
    [PDF] Modeling Dynamic Tactical Behaviors in Combatxxi using ... - DTIC
    This thesis investigates using Hierarchical Task Networks (HTNs) to model military behaviors within the COMBATXXI model, which represents combat operations.
  49. [49]
    [PDF] Learning Hierarchical Task Networks by Observation
    Abstract. Knowledge-based planning methods offer benefits over classical techniques, but they are time consuming and costly to construct.
  50. [50]
    [PDF] Hierarchical Task Network Plan Reuse for Video Games
    Abstract—Hierarchical Task Network Planning is an Auto- mated Planning technique. It is, among other domains, used in. Artificial Intelligence for video ...
  51. [51]
  52. [52]
    [PDF] HTN Planning: Complexity and Expressivity - Computer Science
    Planning proceeds by starting with the the initial task network d , and doing the following steps repeat- edly, until no non-primitive tasks are left: find a ...
  53. [53]
    [PDF] Tight Bounds for HTN Planning - Uni Ulm
    This recursive structure, when combined with partially- ordered tasks, is powerful enough to encode semi-decidable problems (Erol, Hendler, and Nau 1994).
  54. [54]
    [PDF] Integrating Planning and Acting With a Re-Entrant HTN Planner
    A major problem with integrating HTN planning and acting is that, unless the HTN methods are very carefully written, unexpected problems can occur when ...
  55. [55]
    HTN Planning as Heuristic Progression Search
    Apr 21, 2020 · In this article, we propose the use of progression search as basis for heuristic HTN planning systems. Such systems can calculate their heuristics ...Missing: suboptimal DFS large<|control11|><|separator|>
  56. [56]
    POMDP-based control of workflows for crowdsourcing - ScienceDirect
    In this paper we show the value of decision-theoretic techniques for the problem of optimizing workflows used in crowdsourcing.