constraints-scheduling
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConstraints Scheduling
约束调度
Overview
概述
This skill provides guidance for solving constraint-based scheduling problems where the goal is to find time slots that satisfy multiple constraints from different sources (participant availability, existing calendars, preferences, etc.). It emphasizes systematic data extraction, programmatic verification, and proper handling of time granularity requirements.
此技能为解决基于约束的调度问题提供指导,目标是找到能满足来自不同来源(参与者可用时间、现有日历、偏好等)多重约束的时间槽。它强调系统化的数据提取、程序化验证,以及对时间粒度要求的妥善处理。
Workflow
工作流程
Phase 1: Input Verification and Data Extraction
阶段1:输入验证与数据提取
Before any analysis, establish complete and verified data:
- Verify input file integrity first - Check that input files have not been modified and contain expected data before processing
- Extract complete data - Ensure all file contents are fully read (watch for truncation in tool outputs)
- Use appropriate parsers - For structured formats like ICS (iCalendar), use proper parsing libraries rather than manual text extraction
- Document extracted data - Create a clear summary of all extracted events, constraints, and preferences
在进行任何分析之前,需建立完整且经过验证的数据:
- 首先验证输入文件完整性 - 在处理前检查输入文件是否未被修改且包含预期数据
- 提取完整数据 - 确保所有文件内容被完整读取(注意工具输出中的截断情况)
- 使用合适的解析器 - 对于ICS(iCalendar)等结构化格式,使用专用解析库而非手动提取文本
- 记录提取的数据 - 创建所有提取的事件、约束和偏好的清晰摘要
Phase 2: Constraint Classification
阶段2:约束分类
Organize constraints into clear categories before searching for solutions:
-
Hard constraints (must be satisfied):
- Participant availability windows
- Existing calendar conflicts
- Required meeting duration
- Non-negotiable time restrictions
-
Soft constraints (preferences for tie-breaking):
- Preferred days of week
- Preferred times of day
- Buffer time preferences
- Other stated preferences
-
Edge case constraints:
- Boundary conditions (e.g., meeting ending exactly when lunch begins)
- Day-specific rules (e.g., early departure on certain days)
- Buffer requirements (e.g., no meetings after a certain time)
在寻找解决方案之前,将约束整理为清晰的类别:
-
硬约束(必须满足):
- 参与者可用时段
- 现有日历冲突
- 会议时长要求
- 不可协商的时间限制
-
软约束(用于平局决胜的偏好):
- 偏好的星期几
- 偏好的一天中的时段
- 缓冲时间偏好
- 其他明确说明的偏好
-
边缘情况约束:
- 边界条件(例如,会议恰好在午餐开始时结束)
- 特定日期规则(例如,某些日期提前下班)
- 缓冲要求(例如,某个时间之后不安排会议)
Phase 3: Systematic Solution Search
阶段3:系统化解决方案搜索
Implement a comprehensive search approach:
- Respect stated granularity - If the task specifies minute-level granularity, check all possible start times at that granularity (not just hour boundaries)
- Use programmatic verification - Write a script that encodes all constraints and systematically checks every possible time slot
- Single comprehensive script - Avoid duplicating work between manual analysis and code; trust programmatic verification
- Check earliest valid slot - When finding the "earliest" slot, ensure the search starts from the correct baseline and respects granularity
实施全面的搜索方法:
- 遵循指定的粒度 - 如果任务要求分钟级粒度,需检查该粒度下的所有可能开始时间(而非仅小时边界)
- 使用程序化验证 - 编写脚本编码所有约束,系统地检查每个可能的时间槽
- 单一综合脚本 - 避免在手动分析和代码之间重复工作;信任程序化验证
- 检查最早有效时间槽 - 寻找“最早”时间槽时,确保从正确的基准开始搜索并遵循粒度要求
Phase 4: Verification
阶段4:验证
Before finalizing the solution:
- Verify against all hard constraints - Explicitly check each constraint against the selected time
- Document boundary conditions - For edge cases (meeting ending exactly at a constraint boundary), explicitly confirm validity
- Cross-reference with source data - Ensure the selected slot doesn't conflict with any extracted calendar events
- Verify output format - Ensure the output matches any specified format requirements
在确定最终解决方案之前:
- 针对所有硬约束进行验证 - 明确检查所选时间是否满足每个约束
- 记录边界条件 - 对于边缘情况(例如会议恰好结束于约束边界),明确确认其有效性
- 与源数据交叉引用 - 确保所选时间槽与任何提取的日历事件无冲突
- 验证输出格式 - 确保输出符合指定的格式要求
Common Pitfalls
常见陷阱
Data Extraction Issues
数据提取问题
- Truncated file reads - Tool outputs may truncate long files; always verify complete data extraction or use programmatic parsing
- Manual parsing errors - Avoid manually extracting structured data (like ICS events) when libraries exist
- Missing events - Incomplete calendar parsing can lead to scheduling conflicts
- 文件读取截断 - 工具输出可能会截断长文件;始终验证数据是否被完整提取,或使用程序化解析
- 手动解析错误 - 当存在可用库时,避免手动提取结构化数据(如ICS事件)
- 遗漏事件 - 不完整的日历解析可能导致调度冲突
Granularity Mistakes
粒度错误
- Ignoring stated granularity - If minute-level granularity is required, checking only hourly slots may miss valid earlier times
- Boundary assumptions - A meeting at 10:00-11:00 and a constraint starting at 11:00 may or may not conflict depending on requirements
- 忽略指定粒度 - 如果要求分钟级粒度,仅检查小时级时间槽可能会错过更早的有效时间
- 边界假设 - 10:00-11:00的会议与11:00开始的约束是否冲突,取决于具体要求
Analysis Disorganization
分析组织混乱
- Redundant manual analysis - Performing the same constraint checks manually multiple times wastes effort and introduces inconsistency
- Stream-of-consciousness reasoning - Jumping between days and constraints without structure increases error risk
- Late verification - Checking input integrity after analysis is complete, rather than before
- 冗余手动分析 - 多次手动执行相同的约束检查会浪费精力并引入不一致性
- 意识流式推理 - 无结构地在不同日期和约束之间切换会增加错误风险
- 延迟验证 - 在分析完成后才检查输入完整性,而非提前检查
Constraint Handling
约束处理
- Treating soft constraints as hard - Preferences should be tie-breakers, not elimination criteria
- Missing edge cases - Day-specific rules, buffer requirements, and boundary conditions are easily overlooked
- Incomplete constraint enumeration - Failing to extract all constraints from input data
- 将软约束视为硬约束 - 偏好应作为平局决胜的依据,而非排除标准
- 遗漏边缘情况 - 特定日期规则、缓冲要求和边界条件容易被忽略
- 约束枚举不完整 - 未能从输入数据中提取所有约束
Verification Checklist
验证清单
Before submitting a scheduling solution, verify:
- All input files were read completely without truncation
- Input file integrity was verified (not modified)
- All hard constraints are satisfied by the selected time
- No conflicts exist with any extracted calendar events
- Stated granularity requirements were respected in the search
- Edge cases and boundary conditions were explicitly checked
- Soft constraints were used appropriately for selection among valid options
- Output format matches requirements
提交调度解决方案前,需验证:
- 所有输入文件被完整读取,无截断
- 输入文件完整性已验证(未被修改)
- 所选时间满足所有硬约束
- 与任何提取的日历事件无冲突
- 搜索过程遵循了指定的粒度要求
- 已明确检查边缘情况和边界条件
- 软约束被适用于有效选项中的选择
- 输出格式符合要求
Best Practices
最佳实践
- Start with programmatic approach - Immediately write a comprehensive script to parse inputs and check constraints rather than manual analysis
- Use proper libraries - For ICS files, use icalendar or similar libraries; for other structured formats, use appropriate parsers
- Structure analysis hierarchically - Organize by constraint category rather than jumping between different days or time slots
- Single source of truth - Trust programmatic verification; avoid duplicating analysis manually
- Explicit boundary handling - Document how boundary conditions are handled (inclusive vs exclusive endpoints)
- Complete search - When finding "earliest" or "best" slots, search all possibilities at the required granularity
- 从程序化方法开始 - 立即编写综合脚本以解析输入并检查约束,而非手动分析
- 使用专用库 - 对于ICS文件,使用icalendar或类似库;对于其他结构化格式,使用合适的解析器
- 分层组织分析 - 按约束类别组织分析,而非在不同日期或时间槽之间跳跃
- 单一事实来源 - 信任程序化验证;避免手动重复分析
- 明确处理边界条件 - 记录如何处理边界条件(端点包含或排除)
- 完整搜索 - 寻找“最早”或“最佳”时间槽时,在要求的粒度下搜索所有可能性