Iteration final - PROBLEM_DESCRIPTION
Sequence: 5
Timestamp: 2025-07-25 22:46:34

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: weddings[Church_ID, Year] = number of weddings at each church each year (integer)
- Operational parameters align with expected linear objective: minimize ∑(cost_per_wedding[Church_ID, Year] × weddings[Church_ID, Year])
- Business configuration includes: maximum number of weddings allowed per year (used for constraint bound), maximum number of weddings a church can handle (used for constraint bound)
- 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": "wedding",
  "iteration": 1,
  "business_context": "A wedding planning company aims to minimize the total cost of organizing weddings across different churches while ensuring that each church is used within its capacity and that the total number of weddings per year does not exceed a certain limit.",
  "optimization_problem_description": "The company wants to minimize the total cost of organizing weddings by deciding how many weddings to hold at each church each year, considering the church's capacity and the maximum number of weddings allowed per year.",
  "optimization_formulation": {
    "objective": "minimize \u2211(cost_per_wedding[Church_ID, Year] \u00d7 weddings[Church_ID, Year])",
    "decision_variables": "weddings[Church_ID, Year] = number of weddings at each church each year (integer)",
    "constraints": "\u2211(weddings[Church_ID, Year]) \u2264 max_weddings_per_year for each year, weddings[Church_ID, Year] \u2264 church_capacity for each church and year"
  },
  "current_optimization_to_schema_mapping": {
    "objective_coefficients": {
      "cost_per_wedding[Church_ID, Year]": {
        "currently_mapped_to": "cost_per_wedding.cost",
        "mapping_adequacy": "good",
        "description": "cost of organizing a wedding at a specific church in a specific year"
      }
    },
    "constraint_bounds": {
      "max_weddings_per_year": {
        "currently_mapped_to": "business_configuration_logic.max_weddings_per_year",
        "mapping_adequacy": "good",
        "description": "maximum number of weddings allowed per year"
      },
      "church_capacity": {
        "currently_mapped_to": "business_configuration_logic.church_capacity",
        "mapping_adequacy": "good",
        "description": "maximum number of weddings a church can handle"
      }
    },
    "decision_variables": {
      "weddings[Church_ID, Year]": {
        "currently_mapped_to": "weddings.number_of_weddings",
        "mapping_adequacy": "good",
        "description": "number of weddings at each church each year",
        "variable_type": "integer"
      }
    }
  },
  "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 cost per wedding, church capacity, and maximum weddings per year. Business configuration logic updated with scalar parameters and formulas for optimization.

CREATE TABLE cost_per_wedding (
  church_id INTEGER,
  year INTEGER,
  cost FLOAT
);

CREATE TABLE weddings (
  church_id INTEGER,
  year INTEGER,
  number_of_weddings INTEGER
);


```

CURRENT STORED VALUES:
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on industry standards, realistic church capacities, and typical wedding costs. The data ensures that the optimization problem is meaningful and solvable by balancing costs, capacities, and constraints.

-- Realistic data for cost_per_wedding
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2023, 5000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2023, 4500.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2023, 6000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2024, 5200.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2024, 4600.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2024, 6100.0);

-- Realistic data for weddings
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2023, 10);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2023, 15);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2023, 8);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2024, 12);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2024, 16);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2024, 9);


```

DATA DICTIONARY:
{
  "tables": {
    "cost_per_wedding": {
      "business_purpose": "cost of organizing a wedding at a specific church in a specific year",
      "optimization_role": "objective_coefficients",
      "columns": {
        "church_id": {
          "data_type": "INTEGER",
          "business_meaning": "unique identifier for the church",
          "optimization_purpose": "index for cost per wedding",
          "sample_values": "1, 2, 3"
        },
        "year": {
          "data_type": "INTEGER",
          "business_meaning": "year of the wedding",
          "optimization_purpose": "index for cost per wedding",
          "sample_values": "2023, 2024, 2025"
        },
        "cost": {
          "data_type": "FLOAT",
          "business_meaning": "cost of organizing a wedding",
          "optimization_purpose": "coefficient in the objective function",
          "sample_values": "5000.0, 6000.0, 7000.0"
        }
      }
    },
    "weddings": {
      "business_purpose": "number of weddings at each church each year",
      "optimization_role": "decision_variables",
      "columns": {
        "church_id": {
          "data_type": "INTEGER",
          "business_meaning": "unique identifier for the church",
          "optimization_purpose": "index for number of weddings",
          "sample_values": "1, 2, 3"
        },
        "year": {
          "data_type": "INTEGER",
          "business_meaning": "year of the wedding",
          "optimization_purpose": "index for number of weddings",
          "sample_values": "2023, 2024, 2025"
        },
        "number_of_weddings": {
          "data_type": "INTEGER",
          "business_meaning": "number of weddings at the church in the year",
          "optimization_purpose": "decision variable in the optimization model",
          "sample_values": "10, 15, 20"
        }
      }
    }
  }
}


BUSINESS CONFIGURATION:

BUSINESS CONFIGURATION:
{
  "max_weddings_per_year": {
    "data_type": "INTEGER",
    "business_meaning": "maximum number of weddings allowed per year",
    "optimization_role": "constraint bound",
    "configuration_type": "scalar_parameter",
    "value": 120,
    "business_justification": "Reflects a realistic annual limit for weddings across all churches, considering operational capacity."
  },
  "church_capacity": {
    "data_type": "INTEGER",
    "business_meaning": "maximum number of weddings a church can handle",
    "optimization_role": "constraint bound",
    "configuration_type": "scalar_parameter",
    "value": 30,
    "business_justification": "Represents a reasonable maximum number of weddings a single church can handle annually without compromising quality."
  }
}

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: wedding

## 1. Problem Context and Goals

### Context  
[Regenerate business context that naturally aligns with LINEAR optimization formulation. Ensure:]
- Business decisions match expected decision variables: weddings[Church_ID, Year] = number of weddings at each church each year (integer)
- Operational parameters align with expected linear objective: minimize ∑(cost_per_wedding[Church_ID, Year] × weddings[Church_ID, Year])
- Business configuration includes: maximum number of weddings allowed per year (used for constraint bound), maximum number of weddings a church can handle (used for constraint bound)
- 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: minimize
- Metric to optimize: minimize ∑(cost_per_wedding[Church_ID, Year] × weddings[Church_ID, Year])
- 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: ∑(weddings[Church_ID, Year]) ≤ max_weddings_per_year for each year, weddings[Church_ID, Year] ≤ church_capacity for each church and year (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 cost per wedding, church capacity, and maximum weddings per year. Business configuration logic updated with scalar parameters and formulas for optimization.

CREATE TABLE cost_per_wedding (
  church_id INTEGER,
  year INTEGER,
  cost FLOAT
);

CREATE TABLE weddings (
  church_id INTEGER,
  year INTEGER,
  number_of_weddings INTEGER
);


```

### 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 industry standards, realistic church capacities, and typical wedding costs. The data ensures that the optimization problem is meaningful and solvable by balancing costs, capacities, and constraints.

-- Realistic data for cost_per_wedding
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2023, 5000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2023, 4500.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2023, 6000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2024, 5200.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2024, 4600.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2024, 6100.0);

-- Realistic data for weddings
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2023, 10);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2023, 15);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2023, 8);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2024, 12);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2024, 16);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2024, 9);


```

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

Response:
# Complete Optimization Problem and Solution: wedding

## 1. Problem Context and Goals

### Context  
A wedding planning company is tasked with organizing weddings across multiple churches each year. The company aims to minimize the total cost of these weddings while ensuring that each church operates within its capacity and that the total number of weddings per year does not exceed a predefined limit. The key decision involves determining the number of weddings to hold at each church each year, considering the cost of organizing a wedding at each church and the operational constraints.

The cost of organizing a wedding varies by church and year, and these costs are known and fixed. Each church has a maximum capacity for the number of weddings it can handle annually, ensuring that the quality of service is maintained. Additionally, there is a company-wide limit on the total number of weddings that can be organized each year, reflecting the overall operational capacity.

The business configuration includes two critical parameters: the maximum number of weddings allowed per year, which is set to 120, and the maximum number of weddings a single church can handle, which is set to 30. These parameters ensure that the company operates within realistic and sustainable limits.

### Goals  
The primary goal of the optimization is to minimize the total cost of organizing weddings across all churches and years. This is achieved by strategically deciding how many weddings to hold at each church each year, considering the cost per wedding at each location and the operational constraints. Success is measured by achieving the lowest possible total cost while adhering to the capacity limits of each church and the overall annual limit on weddings.

## 2. Constraints    

The optimization problem is subject to two main constraints:

1. **Annual Wedding Limit**: The total number of weddings organized across all churches in a given year must not exceed the maximum number of weddings allowed per year, which is 120. This ensures that the company does not overextend its operational capacity in any single year.

2. **Church Capacity Limit**: The number of weddings held at each church in a given year must not exceed the maximum number of weddings that the church can handle, which is 30. This ensures that each church operates within its capacity, maintaining the quality of service for each wedding.

These constraints ensure that the company operates within realistic and sustainable limits while minimizing costs.

## 3. Available Data  

### Database Schema  
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating tables for cost per wedding, church capacity, and maximum weddings per year. Business configuration logic updated with scalar parameters and formulas for optimization.

CREATE TABLE cost_per_wedding (
  church_id INTEGER,
  year INTEGER,
  cost FLOAT
);

CREATE TABLE weddings (
  church_id INTEGER,
  year INTEGER,
  number_of_weddings INTEGER
);
```

### Data Dictionary  
- **cost_per_wedding**: This table contains the cost of organizing a wedding at a specific church in a specific year. The cost is used as a coefficient in the objective function to calculate the total cost of weddings.
  - **church_id**: Unique identifier for the church.
  - **year**: Year of the wedding.
  - **cost**: Cost of organizing a wedding at the specified church and year.

- **weddings**: This table contains the number of weddings held at each church each year. This data represents the decision variables in the optimization model.
  - **church_id**: Unique identifier for the church.
  - **year**: Year of the wedding.
  - **number_of_weddings**: Number of weddings held at the specified church and year.

### Current Stored Values  
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on industry standards, realistic church capacities, and typical wedding costs. The data ensures that the optimization problem is meaningful and solvable by balancing costs, capacities, and constraints.

-- Realistic data for cost_per_wedding
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2023, 5000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2023, 4500.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2023, 6000.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (1, 2024, 5200.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (2, 2024, 4600.0);
INSERT INTO cost_per_wedding (church_id, year, cost) VALUES (3, 2024, 6100.0);

-- Realistic data for weddings
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2023, 10);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2023, 15);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2023, 8);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (1, 2024, 12);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (2, 2024, 16);
INSERT INTO weddings (church_id, year, number_of_weddings) VALUES (3, 2024, 9);
```
