[![INFORMS Journal on Computing Logo](https://INFORMSJoC.github.io/logos/INFORMS_Journal_on_Computing_Header.jpg)](https://pubsonline.informs.org/journal/ijoc)

# Robust Data-Driven Quasiconcave Optimization

This archive is distributed in association with the [INFORMS Journal on
Computing](https://pubsonline.informs.org/journal/ijoc) under the [MIT License](LICENSE).

The software and data in this repository are a snapshot of the software and data
that were used in the research reported on in the paper 
[Robust Data-Driven Quasiconcave Optimization](https://doi.org/10.1287/ijoc.2025.1570) by J. Wu, W. B. Haskell, W. Huang, and H. Xu.

## Cite

To cite the contents of this repository, please cite both the paper and this repo, using their respective DOIs.

https://doi.org/10.1287/ijoc.2025.1570

https://doi.org/10.1287/ijoc.2025.1570.cd

Below is the BibTex for citing this snapshot of the repository.

```
@misc{RobustQuasiconcaveOpt,
  author =        {J. Wu and W. B. Haskell and W. Huang and H. Xu},
  publisher =     {INFORMS Journal on Computing},
  title =         {{Robust Data-Driven Quasiconcave Optimization}},
  year =          {2026},
  doi =           {10.1287/ijoc.2025.1570.cd},
  url =           {https://github.com/INFORMSJoC/2025.1570},
  note =          {Available for download at https://github.com/INFORMSJoC/2025.1570},
}  
```

## Description

This repository contains the Python implementation of the robust data-driven quasiconcave optimization framework presented in the paper. The code includes:

1. **Quasiconcave Interpolation Methods**: 
   - Worst-case quasiconcave interpolation with Lipschitz constraints
   - Piecewise constant interpolation
   - Concave regression

2. **Robust Optimization Algorithms**:
   - Binary search algorithm for robust quasiconcave optimization
   - Level function method (MILP-based baseline)

3. **Applications**:
   - Cobb-Douglas utility optimization
   - Max-min fairness optimization for facility location

## Repository Structure

```
├── README.md
├── AUTHORS
├── LICENSE
├── requirements.txt
├── scripts/
│   ├── run_experiments.py           # Main experiments for Cobb-Douglas utility
│   └── run_maxmin_experiments.py    # Max-min fairness experiments
├── src/
│   ├── __init__.py
│   ├── core.py                      # Core functions (true function, Lipschitz computation)
│   ├── interpolation.py             # Interpolation methods
│   ├── optimization.py              # Optimization algorithms
│   ├── visualization.py             # Plotting functions
│   ├── maxmin_utility.py            # Max-min utility problem setup
│   ├── maxmin_optimization.py       # Max-min optimization algorithms
│   └── maxmin_visualization.py      # Max-min visualization
└── results/
    └── (figures generated by experiments)
```

## Requirements

The code requires Python 3.8+ and the following packages:

- numpy >= 1.21.0
- pandas >= 1.3.0
- matplotlib >= 3.4.0
- scipy >= 1.7.0
- scikit-learn >= 1.0.0
- cvxpy >= 1.2.0
- highspy >= 1.5.0
- mip >= 1.15.0

Install all dependencies using:

```bash
pip install -r requirements.txt
```

## Replicating Results

### Cobb-Douglas Utility Experiments (Section 6.1)

To run all experiments for the Cobb-Douglas utility function:

```bash
python scripts/run_experiments.py --experiment all
```

Individual experiments can be run separately:

```bash
# Visualization of interpolation methods
python scripts/run_experiments.py --experiment visualize

# L1 error comparison across sample sizes
python scripts/run_experiments.py --experiment l1_error

# Optimality gap comparison
python scripts/run_experiments.py --experiment optimality_gap --n-rep 20

# Scalability of interpolation methods
python scripts/run_experiments.py --experiment scalability_interp

# Scalability of robust optimization
python scripts/run_experiments.py --experiment scalability_ro
```

### Max-Min Fairness Experiments (Section 6.2)

To run all max-min fairness experiments:

```bash
python scripts/run_maxmin_experiments.py --experiment all
```

Individual experiments:

```bash
# Visualization of max-min utility problem
python scripts/run_maxmin_experiments.py --experiment visualize

# L1 error comparison
python scripts/run_maxmin_experiments.py --experiment l1_error --n-rep 20

# Fairness analysis
python scripts/run_maxmin_experiments.py --experiment fairness --n-rep 200

# Computational efficiency comparison
python scripts/run_maxmin_experiments.py --experiment computational --n-rep 50
```

### Command Line Options

Both scripts support the following options:

- `--experiment NAME`: Run specific experiment (default: `all`)
- `--no-plots`: Disable plot generation
- `--n-rep N`: Number of replications for statistical experiments (default: 20)

## Results

Running the experiments will generate:

1. **Figures** in the `results/` directory:
   - `true_func.png`, `true_contour.png`: True objective function visualizations
   - `qco_int.png`, `const_int.png`, `co_reg.png`: Interpolation method comparisons
   - `L1.png`: L1 error vs sample size
   - `maxmin_*.png`: Max-min fairness experiment results

2. **CSV files** in the working directory:
   - `df_optimality_gap_*.csv`: Optimality gap results
   - `df_scalability_*.csv`: Computational scalability results
   - `df_maxmin_*.csv`: Max-min experiment results

## Originality Statement

All source code in this repository, including all scripts and implementation files, is original work developed by the authors specifically for this paper. No part of the code has been used in other projects by the authors or third parties.

## Data Generation

All experimental data used in this repository is randomly generated using procedures developed by the authors. The data generation methods are implemented within the source code (see `src/core.py` and `src/maxmin_utility.py` for the sampling procedures).

## Support

For questions about the code, please contact the authors or submit an issue on this repository.
