Home Knowledge Base HTN planning (Hierarchical Task Network)

HTN planning (Hierarchical Task Network)

Keywords: htn planning (hierarchical task network),htn planning,hierarchical task network,ai agent


HTN planning (Hierarchical Task Network) is a planning approach that decomposes high-level tasks into networks of subtasks hierarchically — using domain-specific knowledge about how complex tasks break down into simpler ones, enabling efficient planning for complex domains by exploiting task structure and procedural knowledge.

What Is HTN Planning?

HTN Components

HTN Example: Making Dinner

Compound Task: make_dinner

Method 1: cook_pasta_dinner
  Subtasks:
    1. boil_water
    2. cook_pasta
    3. make_sauce
    4. combine_pasta_and_sauce
  Ordering: 1 < 2, 3 < 4, 2 < 4

Method 2: order_takeout
  Subtasks:
    1. choose_restaurant
    2. place_order
    3. wait_for_delivery
  Ordering: 1 < 2 < 3

Planner chooses method based on context (time, ingredients available, etc.)

HTN Planning Process

1. Start with Goal: High-level task to accomplish.

2. Select Method: Choose decomposition method for current task.

3. Decompose: Replace task with subtasks from method.

4. Recurse: Repeat for each compound subtask.

5. Primitive Actions: When all tasks are primitive, plan is complete.

6. Backtrack: If decomposition fails, try alternative method.

Example: Robot Assembly Task

Task: assemble_chair

Method: standard_assembly
  Subtasks:
    1. attach_legs_to_seat
    2. attach_backrest_to_seat
    3. tighten_all_screws
  Ordering: 1 < 3, 2 < 3

Task: attach_legs_to_seat
Method: four_leg_attachment
  Subtasks:
    1. attach_leg(leg1)
    2. attach_leg(leg2)
    3. attach_leg(leg3)
    4. attach_leg(leg4)
  Ordering: none (can be done in any order)

Task: attach_leg(L)
  Primitive action: screw(L, seat)

HTN vs. Classical Planning

Advantages of HTN Planning

HTN Planning Algorithms

Applications

Example: Military Mission Planning

Task: conduct_reconnaissance_mission

Method: aerial_reconnaissance
  Subtasks:
    1. prepare_aircraft
    2. fly_to_target_area
    3. perform_surveillance
    4. return_to_base
    5. debrief
  Ordering: 1 < 2 < 3 < 4 < 5

Task: prepare_aircraft
Method: standard_preflight
  Subtasks:
    1. inspect_aircraft
    2. fuel_aircraft
    3. load_equipment
    4. brief_crew
  Ordering: 1 < 2, 1 < 3, 4 < (all others complete)

Partial-Order HTN Planning

HTN with Preconditions and Effects

Challenges

LLMs and HTN Planning

Example: LLM Generating HTN Method

User: "How do I organize a conference?"

LLM generates HTN method:
Task: organize_conference
Method: standard_conference_organization
  Subtasks:
    1. select_venue
    2. invite_speakers
    3. promote_event
    4. manage_registrations
    5. arrange_catering
    6. conduct_conference
    7. follow_up
  Ordering: 1 < 3, 1 < 4, 2 < 6, 5 < 6, 6 < 7

Benefits

Limitations

HTN planning is a powerful approach for complex, structured domains — it exploits hierarchical task structure and domain knowledge to achieve efficient planning, making it particularly effective for real-world applications where expert knowledge about task decomposition is available.


Source: ChipFoundryServicesSearch this topicAsk CFSGPT

htn planning (hierarchical task network)htn planninghierarchical task networkai agent

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.