PHASE 1: Single-Robot Long-Range Task Planning (robot_1):
"""
- Objective:
  - Maximize travel distance and task complexity for robot_1.
  - Ensure all spatial constraints and planning rules are satisfied.
- Planning constraints:
  - robot_1 must:
    - There is no constraint that the start region must have RegionID=0 or any fixed ID.
    - Start in a region far from the target object's region and end region.
    - Not start in a region adjacent to the object.
    - Target object's region and end region are not adjacent.
    - Move only along graph-connected regions.
    - Manipulate only portable objects.
  - The target object must exist in the "object" field of the target region in the scene graph.
  - The end asset must exist in the "asset" field of the end region in the scene graph.
- Output keys (Phase 1):
  - "Single robot start region": Starting region of robot_1.
  - "Single robot target object region": Region where the target object is located.
  - "Target object": target object.
  - "Single robot end region": Region where the target object is delivered.
  - "Single robot travel path": Ordered region-to-region path followed by robot_1. (From step 5: Build the full travel path)
  - "Task instruction": Natural language description of the task for robot_1.
"""
You can call function to help validate and reason:
"""
- check_two_path_and_adjacency(start_region, target_region, end_region):
  - Purpose: To validate whether the selected regions for a single-robot task (start → target → end) satisfy connectivity, adjacency, and path length constraints.
  - INPUT:
    - start_region (string): Proposed starting region of robot_1 (RegionType_RegionID).
    - target_region (string): Region containing the portable object to pick up (RegionType_RegionID).
    - end_region (string): Region to deliver and place the object (RegionType_RegionID).
  - OUTPUT:
    - start_2_target: {
        "connect": true/false,
        "adjacency": true/false,
        "path_length": int,
        "path": list of transitions like ["Kitchen_4 -> Living_room_5", ...]
      }
    - target_2_end: {
        "connect": true/false,
        "adjacency": true/false,
        "path_length": int,
        "path": list of transitions like ["Living_room_5 -> Hallway_2", ...]
      }
    - s2t_valid (bool): Whether start → target path is connected, not adjacent, and path_length ≥ 2
    - t2e_valid (bool): Whether target → end path is connected, not adjacent, and path_length ≥ 2
    - valid (bool): True only if both path segments (s2t and t2e) are valid
"""
Use the following step-by-step reasoning process to ensure the plan satisfies all constraints and is meaningful:
"""
1. Randomly sample a portable object from all regions:
  - Random sample object listed under the object field of each region (these are portable). Do not select assets.
  - Do not weight sampling by the frequency of an object type, every portable object has equal probability.
  - Record the object’s region in format: RegionType_RegionID as target object region.
2. Randomly select a start region for robot_1:
  - Must NOT be adjacent to the target object region.
  - Must be connected to the target object region.
  - Must have a long path to the target object region (prefer path_length >= 2).
3. Randomly select an end region to deliver the object:
  - Must NOT be adjacent to the target object region.
  - Must be connected to the target object region.
  - Must contain a valid asset to place the object (e.g., table, shelf, counter).
  - Randomize among qualified candidates while maximizing path diversity.
  - Must have a long path from the target object's region (prefer path_length >= 2).
4. Validate the region combination using the function `check_two_path_and_adjacency(start_region, target_region, end_region)`:
  - If both path segments are valid:
    - The combination is accepted.
    - LOCK all three regions: start, target, and end.
    - Proceed to generate path and output phase_1.
  - If only the first segment (start → target) is valid:
    - Keep the start and target region fixed (from Step 1 and 2).
    - Retry sampling a new end region only (go back to Step 3).
    - Then call the function again to validate.
  - If only the second segment (target → end) is valid:
    - Keep the target and end region fixed (from Step 1 and 3).
    - Retry sampling a new start region only (go back to Step 2).
    - Then call the function again to validate.
  - If neither segment is valid:
    - All three regions are invalid.
    - Restart from Step 1 to sample a new target object.
5. Build the full travel path:
  - From the start region to the target object region;
  - Then from the target object region to the end region.
  - The travel path must be a concatenation of these two segments, maintaining correct directionality.
  - The last region in the path must be the end region.
  - This list becomes the "Single robot travel path".
6. Output the result as a structured JSON in this format:
{
  "phase_1": {
    "Single robot start region": {"robot_1": "RegionType_RegionID"},
    "Single robot target object region": {"robot_1": "RegionType_RegionID"},
    "Target object": "object",
    "Single robot end region": {"robot_1": "RegionType_RegionID"},
    "Single robot travel path": {"robot_1": [
        "RegionType_RegionID -> RegionType_RegionID",
        ...
    ]},
    "Task instruction": "Take the [object] from [target object region] to the [asset] in [end region]."
  }
}
"""
GENERAL CONSTRAINTS:
"""
- Always respect scene graph connectivity ("link" field).
- Avoid adjacency in robot start regions where specified.
- You are not allowed to infer adjacency or connectivity from the text alone.
- You MUST use the function `check_path_and_adjacency` to verify:
  - whether two regions are connected,
  - whether they are adjacent,
  - and to obtain the path and its length.
- Only return the JSON object. Do not explain your reasoning in the final answer.
- You may use internal reasoning and function calls during planning, but your final output must contain only the JSON.
"""