Iteration final - PROBLEM_DESCRIPTION
Sequence: 5
Timestamp: 2025-07-28 00:05:02

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: selected[i]: binary variable indicating if TV series/cartoon i is selected to air
- Operational parameters align with expected linear objective: maximize total_viewership = ∑(Viewers_m[i] * selected[i])
- Business configuration includes: Total available air time for each channel (used for Used as a constraint in optimization model), Maximum allowable content type per channel (used for Used as a constraint in optimization model), Minimum required viewership from specific demographic groups (used 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": "tvshow",
  "iteration": 1,
  "business_context": "A TV network aims to optimize its programming schedule to maximize viewership across different channels, considering constraints such as air time slots, channel capacity, and viewer demographics.",
  "optimization_problem_description": "The objective is to maximize total viewership by selecting the optimal combination of TV series and cartoons to air on different channels, subject to constraints like available time slots, channel-specific content restrictions, and target audience demographics.",
  "optimization_formulation": {
    "objective": "maximize total_viewership = \u2211(Viewers_m[i] * selected[i])",
    "decision_variables": "selected[i]: binary variable indicating if TV series/cartoon i is selected to air",
    "constraints": [
      "\u2211(Air_Time[i] * selected[i]) \u2264 Total_Available_Time for each channel",
      "\u2211(Content_Type[i] * selected[i]) \u2264 Content_Capacity for each channel",
      "\u2211(Demographic_Target[i] * selected[i]) \u2265 Minimum_Demographic_Target"
    ]
  },
  "current_optimization_to_schema_mapping": {
    "objective_coefficients": {
      "Viewers_m[i]": {
        "currently_mapped_to": "TV_series.Viewers_m",
        "mapping_adequacy": "good",
        "description": "Number of viewers in millions for TV series/cartoon i"
      }
    },
    "constraint_bounds": {
      "Total_Available_Time": {
        "currently_mapped_to": "Channel.Total_Available_Time",
        "mapping_adequacy": "good",
        "description": "Total available air time for each channel"
      },
      "Content_Capacity": {
        "currently_mapped_to": "Channel.Content_Capacity",
        "mapping_adequacy": "good",
        "description": "Maximum allowable content type per channel"
      },
      "Minimum_Demographic_Target": {
        "currently_mapped_to": "business_configuration_logic.Minimum_Demographic_Target",
        "mapping_adequacy": "good",
        "description": "Minimum required viewership from specific demographic groups"
      }
    },
    "decision_variables": {
      "selected[i]": {
        "currently_mapped_to": "TV_series.selected",
        "mapping_adequacy": "good",
        "description": "Indicates if the series or cartoon is selected to air",
        "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 missing optimization data, modifying existing tables to fill mapping gaps, and moving certain parameters to configuration logic for better management.

CREATE TABLE TV_series (
  Viewers_m INTEGER,
  Air_Time INTEGER,
  Content_Type STRING,
  Demographic_Target INTEGER,
  selected BOOLEAN
);

CREATE TABLE Channel (
  Total_Available_Time INTEGER,
  Content_Capacity INTEGER
);


```

CURRENT STORED VALUES:
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical TV network scheduling constraints and viewership data, ensuring a balance between available air time, content capacity, and demographic targets.

-- Realistic data for TV_series
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (2, 60, 'series', 80000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (3, 90, 'cartoon', 120000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (1, 30, 'series', 50000, False);

-- Realistic data for Channel
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (48, 20);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (72, 30);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (24, 10);


```

DATA DICTIONARY:
{
  "tables": {
    "TV_series": {
      "business_purpose": "Stores TV series and cartoon data for scheduling optimization",
      "optimization_role": "business_data",
      "columns": {
        "Viewers_m": {
          "data_type": "INTEGER",
          "business_meaning": "Number of viewers in millions",
          "optimization_purpose": "Objective coefficient for maximizing viewership",
          "sample_values": "1, 2, 3"
        },
        "Air_Time": {
          "data_type": "INTEGER",
          "business_meaning": "Air time required for the series or cartoon",
          "optimization_purpose": "Constraint for total available time",
          "sample_values": "30, 60, 90"
        },
        "Content_Type": {
          "data_type": "STRING",
          "business_meaning": "Type of content (e.g., series, cartoon)",
          "optimization_purpose": "Constraint for channel content capacity",
          "sample_values": "series, cartoon"
        },
        "Demographic_Target": {
          "data_type": "INTEGER",
          "business_meaning": "Target demographic viewership",
          "optimization_purpose": "Constraint for minimum demographic target",
          "sample_values": "50000, 100000, 150000"
        },
        "selected": {
          "data_type": "BOOLEAN",
          "business_meaning": "Indicates if the series or cartoon is selected to air",
          "optimization_purpose": "Decision variable for optimization",
          "sample_values": "true, false"
        }
      }
    },
    "Channel": {
      "business_purpose": "Stores channel data for scheduling optimization",
      "optimization_role": "business_data",
      "columns": {
        "Total_Available_Time": {
          "data_type": "INTEGER",
          "business_meaning": "Total available air time for the channel",
          "optimization_purpose": "Constraint for total available time",
          "sample_values": "24, 48, 72"
        },
        "Content_Capacity": {
          "data_type": "INTEGER",
          "business_meaning": "Maximum allowable content type per channel",
          "optimization_purpose": "Constraint for channel content capacity",
          "sample_values": "10, 20, 30"
        }
      }
    }
  }
}


BUSINESS CONFIGURATION:

BUSINESS CONFIGURATION:
{
  "Total_Available_Time": {
    "data_type": "INTEGER",
    "business_meaning": "Total available air time for each channel",
    "optimization_role": "Used as a constraint in optimization model",
    "configuration_type": "scalar_parameter",
    "value": 48,
    "business_justification": "Reflects a realistic average air time available per channel in a typical TV network."
  },
  "Channel_Content_Capacity": {
    "data_type": "INTEGER",
    "business_meaning": "Maximum allowable content type per channel",
    "optimization_role": "Used as a constraint in optimization model",
    "configuration_type": "scalar_parameter",
    "value": 20,
    "business_justification": "Represents a reasonable capacity for content types that a channel can handle."
  },
  "Minimum_Demographic_Target": {
    "data_type": "INTEGER",
    "business_meaning": "Minimum required viewership from specific demographic groups",
    "optimization_role": "Used as a constraint in optimization model",
    "configuration_type": "scalar_parameter",
    "value": 100000,
    "business_justification": "Ensures that the programming schedule meets a minimum viewership threshold from key demographics."
  }
}

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

## 1. Problem Context and Goals

### Context  
[Regenerate business context that naturally aligns with LINEAR optimization formulation. Ensure:]
- Business decisions match expected decision variables: selected[i]: binary variable indicating if TV series/cartoon i is selected to air
- Operational parameters align with expected linear objective: maximize total_viewership = ∑(Viewers_m[i] * selected[i])
- Business configuration includes: Total available air time for each channel (used for Used as a constraint in optimization model), Maximum allowable content type per channel (used for Used as a constraint in optimization model), Minimum required viewership from specific demographic groups (used 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_viewership = ∑(Viewers_m[i] * selected[i])
- 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: ['∑(Air_Time[i] * selected[i]) ≤ Total_Available_Time for each channel', '∑(Content_Type[i] * selected[i]) ≤ Content_Capacity for each channel', '∑(Demographic_Target[i] * selected[i]) ≥ Minimum_Demographic_Target'] (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 missing optimization data, modifying existing tables to fill mapping gaps, and moving certain parameters to configuration logic for better management.

CREATE TABLE TV_series (
  Viewers_m INTEGER,
  Air_Time INTEGER,
  Content_Type STRING,
  Demographic_Target INTEGER,
  selected BOOLEAN
);

CREATE TABLE Channel (
  Total_Available_Time INTEGER,
  Content_Capacity 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 typical TV network scheduling constraints and viewership data, ensuring a balance between available air time, content capacity, and demographic targets.

-- Realistic data for TV_series
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (2, 60, 'series', 80000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (3, 90, 'cartoon', 120000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (1, 30, 'series', 50000, False);

-- Realistic data for Channel
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (48, 20);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (72, 30);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (24, 10);


```

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

Response:
# Complete Optimization Problem and Solution: tvshow

## 1. Problem Context and Goals

### Context  
The TV network is focused on optimizing its programming schedule to enhance viewership across its various channels. The primary decision involves selecting which TV series and cartoons to air, represented by a binary decision variable indicating whether a particular show is chosen for airing. The network aims to maximize total viewership by considering the number of viewers each show attracts. The operational parameters include the total available air time for each channel, the maximum allowable content type per channel, and the minimum required viewership from specific demographic groups. These parameters are crucial constraints in the optimization model, ensuring that the schedule adheres to channel capacities and demographic targets. The business configuration provides these parameters as scalar values, reflecting realistic operational limits and goals.

### Goals  
The optimization goal is to maximize the total viewership across all channels. This is achieved by selecting the optimal combination of TV series and cartoons to air, with the metric for optimization being the total number of viewers. Success is measured by the ability to maximize this viewership while adhering to the constraints provided by the operational parameters. The goal is articulated in natural language, focusing on increasing the audience size through strategic programming decisions.

## 2. Constraints    

The constraints for this optimization problem are designed to ensure that the programming schedule is feasible and meets the network's operational requirements:

- The total air time used by the selected TV series and cartoons must not exceed the available air time for each channel. This ensures that the schedule fits within the channel's broadcasting capacity.
- The content type selected for each channel must not exceed the channel's content capacity. This constraint ensures a balanced and diverse programming lineup.
- The selected programming must achieve a minimum viewership from specific demographic groups, ensuring that the network meets its audience engagement targets.

These constraints are expressed in business terms that naturally align with linear mathematical forms, avoiding any nonlinear relationships.

## 3. Available Data  

### Database Schema  
```sql
-- Iteration 1 Database Schema
-- Objective: Schema changes include creating new tables for missing optimization data, modifying existing tables to fill mapping gaps, and moving certain parameters to configuration logic for better management.

CREATE TABLE TV_series (
  Viewers_m INTEGER,
  Air_Time INTEGER,
  Content_Type STRING,
  Demographic_Target INTEGER,
  selected BOOLEAN
);

CREATE TABLE Channel (
  Total_Available_Time INTEGER,
  Content_Capacity INTEGER
);
```

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

- **TV_series Table**: This table stores information about TV series and cartoons, crucial for scheduling optimization.
  - **Viewers_m**: Represents the number of viewers in millions for each show, serving as the objective coefficient for maximizing viewership.
  - **Air_Time**: Indicates the air time required for each show, used as a constraint for total available time.
  - **Content_Type**: Describes the type of content (e.g., series, cartoon), used to ensure content capacity constraints are met.
  - **Demographic_Target**: Specifies the target demographic viewership, ensuring that minimum demographic targets are achieved.
  - **selected**: A binary indicator of whether a show is selected to air, serving as the decision variable in the optimization.

- **Channel Table**: This table contains data about each channel's scheduling constraints.
  - **Total_Available_Time**: The total air time available for each channel, used as a constraint in the optimization model.
  - **Content_Capacity**: The maximum allowable content type per channel, ensuring a balanced programming schedule.

### Current Stored Values  
```sql
-- Iteration 1 Realistic Data
-- Generated by triple expert (business + data + optimization)
-- Values were determined based on typical TV network scheduling constraints and viewership data, ensuring a balance between available air time, content capacity, and demographic targets.

-- Realistic data for TV_series
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (2, 60, 'series', 80000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (3, 90, 'cartoon', 120000, False);
INSERT INTO TV_series (Viewers_m, Air_Time, Content_Type, Demographic_Target, selected) VALUES (1, 30, 'series', 50000, False);

-- Realistic data for Channel
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (48, 20);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (72, 30);
INSERT INTO Channel (Total_Available_Time, Content_Capacity) VALUES (24, 10);
```
