Iteration final - PROBLEM_DESCRIPTION
Sequence: 5
Timestamp: 2025-07-25 22:27:23

Prompt:
You are a business analyst creating structured optimization problem documentation.

DATA SOURCES EXPLANATION:
- FINAL OR ANALYSIS: Final converged optimization problem from alternating process (iteration 1), contains business context and schema mapping evaluation
- DATABASE SCHEMA: Current database structure after iterative adjustments  
- DATA DICTIONARY: Business meanings and optimization roles of tables and columns
- CURRENT STORED VALUES: Realistic business data generated by triple expert (business + data + optimization)
- BUSINESS CONFIGURATION: Scalar parameters and business logic formulas separated from table data

CRITICAL REQUIREMENTS: 
- Ensure problem description naturally leads to LINEAR or MIXED-INTEGER optimization formulation
- Make business context consistent with the intended decision variables and objectives
- Align constraint descriptions with expected mathematical constraints
- Ensure data descriptions map clearly to expected coefficient sources
- Maintain business authenticity while fixing mathematical consistency issues
- Avoid business scenarios that would naturally require nonlinear relationships (variable products, divisions, etc.)

AUTO-EXTRACTED CONTEXT REQUIREMENTS:
- Business decisions match expected decision variables: X_ij: binary decision variable indicating whether teacher i is assigned to course j.
- Operational parameters align with expected linear objective: maximize ∑(Grade_ij × X_ij) where Grade_ij is the grade for teacher i teaching course j, and X_ij is a binary decision variable indicating whether teacher i is assigned to course j.
- Business configuration includes: Maximum number of courses a teacher can handle (used for Constraint bound for teacher assignments)
- Business logic formulas to express in natural language: Calculates the teaching quality for a teacher-course pair (calculation method for Objective coefficient calculation)
- Use natural language to precisely describe linear mathematical relationships
- NO mathematical formulas, equations, or symbolic notation
- Present data as current operational information
- Focus on precise operational decision-making that leads to linear formulations
- Resource limitations match expected linear constraints
- Avoid scenarios requiring variable products, divisions, or other nonlinear relationships
- Include specific operational parameters that map to expected coefficient sources
- Reference business configuration parameters where appropriate

FINAL OR ANALYSIS:
{
  "database_id": "course_teach",
  "iteration": 1,
  "business_context": "A university aims to optimize the assignment of teachers to courses to maximize the overall teaching quality, measured by the sum of grades assigned to each course-teacher pair, while respecting constraints on teacher availability and course requirements.",
  "optimization_problem_description": "Maximize the total teaching quality by assigning teachers to courses based on their grades. Constraints include ensuring each course is assigned exactly one teacher and each teacher is assigned to no more than a specified number of courses.",
  "optimization_formulation": {
    "objective": "maximize \u2211(Grade_ij \u00d7 X_ij) where Grade_ij is the grade for teacher i teaching course j, and X_ij is a binary decision variable indicating whether teacher i is assigned to course j.",
    "decision_variables": "X_ij: binary decision variable indicating whether teacher i is assigned to course j.",
    "constraints": "\u2211(X_ij) = 1 for each course j, \u2211(X_ij) \u2264 Max_Courses_i for each teacher i."
  },
  "current_optimization_to_schema_mapping": {
    "objective_coefficients": {
      "Grade_ij": {
        "currently_mapped_to": "course_arrange.Grade",
        "mapping_adequacy": "good",
        "description": "Teaching quality grade for a teacher-course pair."
      }
    },
    "constraint_bounds": {
      "Max_Courses_i": {
        "currently_mapped_to": "teacher_max_courses.max_courses",
        "mapping_adequacy": "good",
        "description": "Maximum number of courses a teacher can handle."
      }
    },
    "decision_variables": {
      "X_ij": {
        "currently_mapped_to": "teacher_course_assignment.assignment_status",
        "mapping_adequacy": "good",
        "description": "Binary decision variable indicating whether teacher i is assigned to course j.",
        "variable_type": "binary"
      }
    }
  },
  "missing_optimization_requirements": [],
  "iteration_status": {
    "complete": true,
    "confidence": "high",
    "next_focus": "Ready for convergence"
  }
}

FINAL DATABASE SCHEMA:
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating tables for decision variables and constraint bounds, and updating business configuration logic to handle scalar parameters and formulas.

CREATE TABLE teacher_course_assignment (
  assignment_status BOOLEAN
);

CREATE TABLE teacher_max_courses (
  max_courses INTEGER
);

CREATE TABLE course_arrange (
  Grade FLOAT
);


```

CURRENT STORED VALUES:
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical university course and teacher capacities, ensuring realistic teaching loads and quality grades.

-- Realistic data for teacher_course_assignment
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (False);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);

-- Realistic data for teacher_max_courses
INSERT INTO teacher_max_courses (max_courses) VALUES (4);
INSERT INTO teacher_max_courses (max_courses) VALUES (3);
INSERT INTO teacher_max_courses (max_courses) VALUES (5);

-- Realistic data for course_arrange
INSERT INTO course_arrange (Grade) VALUES (4.5);
INSERT INTO course_arrange (Grade) VALUES (3.7);
INSERT INTO course_arrange (Grade) VALUES (4.0);
INSERT INTO course_arrange (Grade) VALUES (3.5);
INSERT INTO course_arrange (Grade) VALUES (4.2);


```

DATA DICTIONARY:
{
  "tables": {
    "teacher_course_assignment": {
      "business_purpose": "Represents the assignment of teachers to courses",
      "optimization_role": "decision_variables",
      "columns": {
        "assignment_status": {
          "data_type": "BOOLEAN",
          "business_meaning": "Indicates if a teacher is assigned to a course",
          "optimization_purpose": "Binary decision variable in optimization",
          "sample_values": "true, false"
        }
      }
    },
    "teacher_max_courses": {
      "business_purpose": "Represents the maximum number of courses each teacher can handle",
      "optimization_role": "constraint_bounds",
      "columns": {
        "max_courses": {
          "data_type": "INTEGER",
          "business_meaning": "Maximum number of courses a teacher can handle",
          "optimization_purpose": "Constraint bound in optimization",
          "sample_values": "3, 4, 5"
        }
      }
    },
    "course_arrange": {
      "business_purpose": "Represents the arrangement of courses and their grades",
      "optimization_role": "objective_coefficients",
      "columns": {
        "Grade": {
          "data_type": "FLOAT",
          "business_meaning": "Teaching quality grade for a teacher-course pair",
          "optimization_purpose": "Objective coefficient in optimization",
          "sample_values": "4.5, 3.7, 4.0"
        }
      }
    }
  }
}


BUSINESS CONFIGURATION:

BUSINESS CONFIGURATION:
{
  "Max_Courses_i": {
    "data_type": "INTEGER",
    "business_meaning": "Maximum number of courses a teacher can handle",
    "optimization_role": "Constraint bound for teacher assignments",
    "configuration_type": "scalar_parameter",
    "value": 4,
    "business_justification": "This value represents a realistic average maximum number of courses a teacher can handle, balancing workload and teaching quality."
  },
  "Teaching_Quality_Formula": {
    "data_type": "STRING",
    "business_meaning": "Calculates the teaching quality for a teacher-course pair",
    "optimization_role": "Objective coefficient calculation",
    "configuration_type": "business_logic_formula",
    "formula_expression": "Grade_ij * X_ij"
  }
}

Business Configuration Design: 
Our system separates business logic design from value determination:
- Configuration Logic (business_configuration_logic.json): Templates designed by data engineers with sample_value for scalars and actual formulas for business logic
- Configuration Values (business_configuration.json): Realistic values determined by domain experts for scalar parameters only
- Design Rationale: Ensures business logic consistency while allowing flexible parameter tuning


TASK: Create structured markdown documentation for SECTIONS 1-3 ONLY (Problem Description).

EXACT MARKDOWN STRUCTURE TO FOLLOW:

# Complete Optimization Problem and Solution: course_teach

## 1. Problem Context and Goals

### Context  
[Regenerate business context that naturally aligns with LINEAR optimization formulation. Ensure:]
- Business decisions match expected decision variables: X_ij: binary decision variable indicating whether teacher i is assigned to course j.
- Operational parameters align with expected linear objective: maximize ∑(Grade_ij × X_ij) where Grade_ij is the grade for teacher i teaching course j, and X_ij is a binary decision variable indicating whether teacher i is assigned to course j.
- Business configuration includes: Maximum number of courses a teacher can handle (used for Constraint bound for teacher assignments)
- Business logic formulas to express in natural language: Calculates the teaching quality for a teacher-course pair (calculation method for Objective coefficient calculation)
- Use natural language to precisely describe linear mathematical relationships
- NO mathematical formulas, equations, or symbolic notation
- Present data as current operational information
- Focus on precise operational decision-making that leads to linear formulations
- Resource limitations match expected linear constraints
- Avoid scenarios requiring variable products, divisions, or other nonlinear relationships
- Include specific operational parameters that map to expected coefficient sources
- Reference business configuration parameters where appropriate
- CRITICAL: Include ALL business configuration information (scalar parameters AND business logic formulas) in natural business language

### Goals  
[Regenerate goals that clearly lead to LINEAR mathematical objective:]
- Optimization goal: maximize
- Metric to optimize: maximize ∑(Grade_ij × X_ij) where Grade_ij is the grade for teacher i teaching course j, and X_ij is a binary decision variable indicating whether teacher i is assigned to course j.
- Success measurement aligned with expected coefficient sources
- Use natural language to precisely describe linear optimization goal
- NO mathematical formulas, equations, or symbolic notation

## 2. Constraints    

[Regenerate constraints that directly match expected LINEAR mathematical constraints:]
- Expected constraint: ∑(X_ij) = 1 for each course j, ∑(X_ij) ≤ Max_Courses_i for each teacher i. (Form: Standard constraint form based on business requirements)

[Each constraint should be described in business terms that naturally lead to LINEAR mathematical forms (no variable products or divisions)]

## 3. Available Data  

### Database Schema  
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating tables for decision variables and constraint bounds, and updating business configuration logic to handle scalar parameters and formulas.

CREATE TABLE teacher_course_assignment (
  assignment_status BOOLEAN
);

CREATE TABLE teacher_max_courses (
  max_courses INTEGER
);

CREATE TABLE course_arrange (
  Grade FLOAT
);


```

### Data Dictionary  
[Create comprehensive business-oriented data dictionary mapping tables and columns to their business purposes and optimization roles - NOT technical database terms. Base this on the data_dictionary provided but rewrite in business language that clearly connects to the expected linear mathematical formulation]

### Current Stored Values  
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical university course and teacher capacities, ensuring realistic teaching loads and quality grades.

-- Realistic data for teacher_course_assignment
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (False);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);

-- Realistic data for teacher_max_courses
INSERT INTO teacher_max_courses (max_courses) VALUES (4);
INSERT INTO teacher_max_courses (max_courses) VALUES (3);
INSERT INTO teacher_max_courses (max_courses) VALUES (5);

-- Realistic data for course_arrange
INSERT INTO course_arrange (Grade) VALUES (4.5);
INSERT INTO course_arrange (Grade) VALUES (3.7);
INSERT INTO course_arrange (Grade) VALUES (4.0);
INSERT INTO course_arrange (Grade) VALUES (3.5);
INSERT INTO course_arrange (Grade) VALUES (4.2);


```

STOP HERE - Do not include section 4 (Mathematical Optimization Formulation).

Response:
# Complete Optimization Problem and Solution: course_teach

## 1. Problem Context and Goals

### Context  
A university is focused on optimizing the assignment of teachers to courses to maximize the overall teaching quality. The teaching quality for each course-teacher pair is measured by a grade, which reflects the effectiveness of the teacher in delivering the course content. The university must ensure that each course is assigned exactly one teacher and that no teacher is assigned more courses than they can handle, as defined by a maximum course limit per teacher.  

The decision-making process involves determining whether a specific teacher is assigned to a specific course, represented as a binary choice. The teaching quality grade for each teacher-course pair serves as the basis for evaluating the effectiveness of the assignment. The maximum number of courses a teacher can handle is a key operational parameter, ensuring that teachers are not overburdened while maintaining teaching quality.  

The business logic calculates the teaching quality for each teacher-course pair by multiplying the grade for that pair by the binary decision variable indicating the assignment. This ensures that the total teaching quality is a linear combination of the grades for all assigned pairs.  

### Goals  
The primary goal of this optimization problem is to maximize the total teaching quality across all course-teacher assignments. This is achieved by assigning teachers to courses in a way that ensures the highest possible sum of teaching quality grades, while respecting the constraints on teacher availability and course requirements. Success is measured by the total teaching quality score, which is directly derived from the grades of the assigned teacher-course pairs.  

## 2. Constraints  

The optimization problem must adhere to the following constraints:  
1. **Course Assignment Constraint**: Each course must be assigned exactly one teacher. This ensures that all courses are covered without overlap.  
2. **Teacher Capacity Constraint**: Each teacher can be assigned to no more than their maximum allowable number of courses. This prevents overloading teachers and maintains a balanced workload.  

These constraints are designed to ensure that the assignments are feasible and align with the operational capabilities of the university.  

## 3. Available Data  

### Database Schema  
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating tables for decision variables and constraint bounds, and updating business configuration logic to handle scalar parameters and formulas.

CREATE TABLE teacher_course_assignment (
  assignment_status BOOLEAN
);

CREATE TABLE teacher_max_courses (
  max_courses INTEGER
);

CREATE TABLE course_arrange (
  Grade FLOAT
);
```

### Data Dictionary  
- **teacher_course_assignment**:  
  - **Business Purpose**: Represents the assignment of teachers to courses.  
  - **Optimization Role**: Decision variables indicating whether a teacher is assigned to a course.  
  - **Columns**:  
    - **assignment_status**: A binary value (true/false) indicating whether a teacher is assigned to a course.  

- **teacher_max_courses**:  
  - **Business Purpose**: Represents the maximum number of courses each teacher can handle.  
  - **Optimization Role**: Constraint bounds limiting the number of courses per teacher.  
  - **Columns**:  
    - **max_courses**: An integer value representing the maximum number of courses a teacher can handle.  

- **course_arrange**:  
  - **Business Purpose**: Represents the arrangement of courses and their associated teaching quality grades.  
  - **Optimization Role**: Objective coefficients used to calculate the total teaching quality.  
  - **Columns**:  
    - **Grade**: A floating-point value representing the teaching quality grade for a teacher-course pair.  

### Current Stored Values  
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical university course and teacher capacities, ensuring realistic teaching loads and quality grades.

-- Realistic data for teacher_course_assignment
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (False);
INSERT INTO teacher_course_assignment (assignment_status) VALUES (True);

-- Realistic data for teacher_max_courses
INSERT INTO teacher_max_courses (max_courses) VALUES (4);
INSERT INTO teacher_max_courses (max_courses) VALUES (3);
INSERT INTO teacher_max_courses (max_courses) VALUES (5);

-- Realistic data for course_arrange
INSERT INTO course_arrange (Grade) VALUES (4.5);
INSERT INTO course_arrange (Grade) VALUES (3.7);
INSERT INTO course_arrange (Grade) VALUES (4.0);
INSERT INTO course_arrange (Grade) VALUES (3.5);
INSERT INTO course_arrange (Grade) VALUES (4.2);
```
