Iteration final - PROBLEM_DESCRIPTION
Sequence: 5
Timestamp: 2025-07-28 00:19:24

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: wedding_allocation[Church_ID, Male_ID, Female_ID] (binary)
- Operational parameters align with expected linear objective: maximize total_weddings = ∑(wedding_allocation[Church_ID, Male_ID, Female_ID])
- Business configuration includes: Maximum number of weddings a church can host per year (used for Used as a constraint bound in optimization model)
- Business logic formulas to express in natural language: Ensures each participant is involved in at most one wedding (calculation method for Used as a constraint in optimization model)
- 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": "Optimize the allocation of weddings to churches to maximize the number of weddings held while respecting church availability and ensuring each participant is involved in at most one wedding.",
  "optimization_problem_description": "Maximize the number of weddings held in available churches, ensuring that each wedding has one male and one female participant, each participant is involved in at most one wedding, and each church can host a limited number of weddings per year.",
  "optimization_formulation": {
    "objective": "maximize total_weddings = \u2211(wedding_allocation[Church_ID, Male_ID, Female_ID])",
    "decision_variables": "wedding_allocation[Church_ID, Male_ID, Female_ID] (binary)",
    "constraints": [
      "\u2211(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= ChurchCapacity.capacity for each Church_ID",
      "\u2211(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= 1 for each Male_ID",
      "\u2211(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= 1 for each Female_ID"
    ]
  },
  "current_optimization_to_schema_mapping": {
    "objective_coefficients": {
      "total_weddings": {
        "currently_mapped_to": "wedding.total_weddings",
        "mapping_adequacy": "good",
        "description": "Represents the total number of weddings to be maximized"
      }
    },
    "constraint_bounds": {
      "church_capacity[Church_ID]": {
        "currently_mapped_to": "ChurchCapacity.capacity",
        "mapping_adequacy": "good",
        "description": "Maximum number of weddings a church can host"
      },
      "unique_male_participation[Male_ID]": {
        "currently_mapped_to": "ParticipantConstraints.constraint_type",
        "mapping_adequacy": "good",
        "description": "Ensures each male participant is involved in at most one wedding"
      },
      "unique_female_participation[Female_ID]": {
        "currently_mapped_to": "ParticipantConstraints.constraint_type",
        "mapping_adequacy": "good",
        "description": "Ensures each female participant is involved in at most one wedding"
      }
    },
    "decision_variables": {
      "wedding_allocation[Church_ID, Male_ID, Female_ID]": {
        "currently_mapped_to": "wedding.Church_ID, wedding.Male_ID, wedding.Female_ID",
        "mapping_adequacy": "good",
        "description": "Binary variable indicating if a wedding is allocated to a church with specific participants",
        "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 new tables for church capacities and participant constraints, modifying existing tables to improve mapping adequacy, and updating configuration logic for scalar parameters and formulas.

CREATE TABLE wedding (
  Church_ID INTEGER,
  Male_ID INTEGER,
  Female_ID INTEGER,
  total_weddings INTEGER
);

CREATE TABLE ChurchCapacity (
  church_id INTEGER,
  capacity INTEGER
);

CREATE TABLE ParticipantConstraints (
  participant_id INTEGER,
  constraint_type STRING
);


```

CURRENT STORED VALUES:
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical church capacities and participant availability to ensure a realistic and solvable optimization problem.

-- Realistic data for wedding
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (1, 101, 201, 10);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (2, 102, 202, 15);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (3, 103, 203, 20);

-- Realistic data for ChurchCapacity
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (1, 100);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (2, 150);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (3, 200);

-- Realistic data for ParticipantConstraints
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (101, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (102, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (103, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (201, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (202, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (203, 'female');


```

DATA DICTIONARY:
{
  "tables": {
    "wedding": {
      "business_purpose": "Stores information about weddings held at churches",
      "optimization_role": "decision_variables",
      "columns": {
        "Church_ID": {
          "data_type": "INTEGER",
          "business_meaning": "Identifier for the church",
          "optimization_purpose": "Used to allocate weddings to churches",
          "sample_values": "1, 2, 3"
        },
        "Male_ID": {
          "data_type": "INTEGER",
          "business_meaning": "Identifier for the male participant",
          "optimization_purpose": "Used to ensure unique male participation",
          "sample_values": "101, 102, 103"
        },
        "Female_ID": {
          "data_type": "INTEGER",
          "business_meaning": "Identifier for the female participant",
          "optimization_purpose": "Used to ensure unique female participation",
          "sample_values": "201, 202, 203"
        },
        "total_weddings": {
          "data_type": "INTEGER",
          "business_meaning": "Total number of weddings held",
          "optimization_purpose": "Objective coefficient for maximizing weddings",
          "sample_values": "10, 15, 20"
        }
      }
    },
    "ChurchCapacity": {
      "business_purpose": "Stores capacity limits for each church",
      "optimization_role": "constraint_bounds",
      "columns": {
        "church_id": {
          "data_type": "INTEGER",
          "business_meaning": "Identifier for the church",
          "optimization_purpose": "Links to church capacity constraints",
          "sample_values": "1, 2, 3"
        },
        "capacity": {
          "data_type": "INTEGER",
          "business_meaning": "Maximum number of weddings a church can host",
          "optimization_purpose": "Constraint bound for church capacity",
          "sample_values": "100, 150, 200"
        }
      }
    },
    "ParticipantConstraints": {
      "business_purpose": "Ensures unique participation of individuals in weddings",
      "optimization_role": "constraint_bounds",
      "columns": {
        "participant_id": {
          "data_type": "INTEGER",
          "business_meaning": "Identifier for the participant",
          "optimization_purpose": "Ensures unique participation",
          "sample_values": "101, 102, 201"
        },
        "constraint_type": {
          "data_type": "STRING",
          "business_meaning": "Type of participation constraint",
          "optimization_purpose": "Defines the constraint logic",
          "sample_values": "male, female"
        }
      }
    }
  }
}


BUSINESS CONFIGURATION:

BUSINESS CONFIGURATION:
{
  "church_capacity": {
    "data_type": "INTEGER",
    "business_meaning": "Maximum number of weddings a church can host per year",
    "optimization_role": "Used as a constraint bound in optimization model",
    "configuration_type": "scalar_parameter",
    "value": 150,
    "business_justification": "An average capacity of 150 weddings per year is realistic for medium-sized churches."
  },
  "unique_participation_formula": {
    "data_type": "STRING",
    "business_meaning": "Ensures each participant is involved in at most one wedding",
    "optimization_role": "Used as a constraint in optimization model",
    "configuration_type": "business_logic_formula",
    "formula_expression": "SUM(wedding_allocation[church_id, male_id, female_id]) <= 1"
  }
}

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: wedding_allocation[Church_ID, Male_ID, Female_ID] (binary)
- Operational parameters align with expected linear objective: maximize total_weddings = ∑(wedding_allocation[Church_ID, Male_ID, Female_ID])
- Business configuration includes: Maximum number of weddings a church can host per year (used for Used as a constraint bound in optimization model)
- Business logic formulas to express in natural language: Ensures each participant is involved in at most one wedding (calculation method for Used as a constraint in optimization model)
- 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 total_weddings = ∑(wedding_allocation[Church_ID, Male_ID, Female_ID])
- 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: ['∑(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= ChurchCapacity.capacity for each Church_ID', '∑(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= 1 for each Male_ID', '∑(wedding_allocation[Church_ID, Male_ID, Female_ID]) <= 1 for each Female_ID'] (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 new tables for church capacities and participant constraints, modifying existing tables to improve mapping adequacy, and updating configuration logic for scalar parameters and formulas.

CREATE TABLE wedding (
  Church_ID INTEGER,
  Male_ID INTEGER,
  Female_ID INTEGER,
  total_weddings INTEGER
);

CREATE TABLE ChurchCapacity (
  church_id INTEGER,
  capacity INTEGER
);

CREATE TABLE ParticipantConstraints (
  participant_id INTEGER,
  constraint_type STRING
);


```

### 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 church capacities and participant availability to ensure a realistic and solvable optimization problem.

-- Realistic data for wedding
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (1, 101, 201, 10);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (2, 102, 202, 15);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (3, 103, 203, 20);

-- Realistic data for ChurchCapacity
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (1, 100);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (2, 150);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (3, 200);

-- Realistic data for ParticipantConstraints
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (101, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (102, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (103, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (201, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (202, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (203, 'female');


```

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

Response:
# Complete Optimization Problem and Solution: wedding

## 1. Problem Context and Goals

### Context  
The objective is to optimize the allocation of weddings to churches in a manner that maximizes the total number of weddings held. This involves making decisions about which church will host each wedding, with the decision variables being whether a wedding is allocated to a specific church with a particular male and female participant. The operational parameters are aligned with the goal of maximizing the total number of weddings, which is achieved by summing the allocations across all churches and participants.

Each church has a maximum number of weddings it can host per year, which serves as a constraint in the optimization model. Additionally, business logic ensures that each participant, whether male or female, is involved in at most one wedding. This is expressed in natural language as a constraint that limits each participant to a single wedding engagement.

The data presented reflects current operational information, focusing on precise decision-making that leads to a linear formulation. Resource limitations, such as church capacity and participant availability, are considered as linear constraints. The business configuration includes both scalar parameters, like the maximum number of weddings a church can host, and business logic formulas that ensure unique participation.

### Goals  
The primary goal of this optimization problem is to maximize the total number of weddings held across all available churches. The metric to optimize is the total number of weddings, which is calculated by summing the allocations of weddings to churches, ensuring that each wedding involves one male and one female participant. Success is measured by the ability to maximize this total while adhering to the constraints of church capacity and unique participant involvement. The optimization goal is described in natural language, focusing on maximizing the number of weddings without using mathematical formulas or symbolic notation.

## 2. Constraints    

The constraints for this optimization problem are designed to ensure that the allocation of weddings adheres to the operational limitations of the churches and the unique participation of individuals:

- Each church can host a limited number of weddings per year, which is determined by its capacity. This constraint ensures that the total number of weddings allocated to a church does not exceed its capacity.
- Each male participant can be involved in at most one wedding. This constraint ensures that no male participant is allocated to more than one wedding.
- Each female participant can be involved in at most one wedding. This constraint ensures that no female participant is allocated to more than one wedding.

These constraints are described in business terms that naturally lead to linear mathematical forms, avoiding any nonlinear relationships such as variable products or divisions.

## 3. Available Data  

### Database Schema  
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating new tables for church capacities and participant constraints, modifying existing tables to improve mapping adequacy, and updating configuration logic for scalar parameters and formulas.

CREATE TABLE wedding (
  Church_ID INTEGER,
  Male_ID INTEGER,
  Female_ID INTEGER,
  total_weddings INTEGER
);

CREATE TABLE ChurchCapacity (
  church_id INTEGER,
  capacity INTEGER
);

CREATE TABLE ParticipantConstraints (
  participant_id INTEGER,
  constraint_type STRING
);
```

### Data Dictionary  
The data dictionary provides a comprehensive mapping of tables and columns to their business purposes and optimization roles:

- **Wedding Table**: This table stores information about weddings held at churches. It plays a crucial role in the optimization as it contains the decision variables for allocating weddings. The columns include:
  - **Church_ID**: Identifies the church where the wedding is held. It is used to allocate weddings to specific churches.
  - **Male_ID**: Identifies the male participant in the wedding. It ensures unique male participation.
  - **Female_ID**: Identifies the female participant in the wedding. It ensures unique female participation.
  - **Total_Weddings**: Represents the total number of weddings held, serving as the objective coefficient for maximizing weddings.

- **ChurchCapacity Table**: This table stores the capacity limits for each church, which are used as constraint bounds in the optimization model. The columns include:
  - **Church_ID**: Identifies the church and links to the church capacity constraints.
  - **Capacity**: Indicates the maximum number of weddings a church can host, serving as a constraint bound.

- **ParticipantConstraints Table**: This table ensures the unique participation of individuals in weddings. The columns include:
  - **Participant_ID**: Identifies the participant, ensuring unique participation.
  - **Constraint_Type**: Defines the type of participation constraint, such as male or female.

### Current Stored Values  
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical church capacities and participant availability to ensure a realistic and solvable optimization problem.

-- Realistic data for wedding
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (1, 101, 201, 10);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (2, 102, 202, 15);
INSERT INTO wedding (Church_ID, Male_ID, Female_ID, total_weddings) VALUES (3, 103, 203, 20);

-- Realistic data for ChurchCapacity
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (1, 100);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (2, 150);
INSERT INTO ChurchCapacity (church_id, capacity) VALUES (3, 200);

-- Realistic data for ParticipantConstraints
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (101, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (102, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (103, 'male');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (201, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (202, 'female');
INSERT INTO ParticipantConstraints (participant_id, constraint_type) VALUES (203, 'female');
```
