## Problem Description and Formulation

The hedge fund has $3,200,000 available for investment in four types of assets: stocks, options, security swaps, and futures. The annual rates of return for these assets are 11%, 30%, 5%, and 15%, respectively. The fund's investment manager has imposed three restrictions on the portfolio:

1. The amount invested in futures cannot exceed the amount invested in stocks.
2. At most 35% of the total amount invested may be in futures.
3. The amount invested in options cannot exceed the amount invested in security swaps.

The objective is to maximize the annual return on the investment portfolio.

## Symbolic Representation

Let's denote the amount invested in each asset as:

* \(S\): stocks
* \(O\): options
* \(SS\): security swaps
* \(F\): futures

The annual rates of return are:

* \(r_S = 0.11\)
* \(r_O = 0.30\)
* \(r_{SS} = 0.05\)
* \(r_F = 0.15\)

The constraints can be written as:

1. \(F \leq S\)
2. \(F \leq 0.35 \times (S + O + SS + F)\)
3. \(O \leq SS\)

The objective function to maximize is:

\[ \text{Maximize:} \quad 0.11S + 0.30O + 0.05SS + 0.15F \]

Subject to:

* \(S + O + SS + F = 3,200,000\) (budget constraint)
* \(S, O, SS, F \geq 0\) (non-negativity constraint)

## Gurobi Code

```python
import gurobi

def hedge_fund_optimization():
    # Create a new model
    model = gurobi.Model()

    # Define variables
    S = model.addVar(name="stocks", lb=0)
    O = model.addVar(name="options", lb=0)
    SS = model.addVar(name="security_swaps", lb=0)
    F = model.addVar(name="futures", lb=0)

    # Objective function
    model.setObjective(0.11 * S + 0.30 * O + 0.05 * SS + 0.15 * F, gurobi.GRB.MAXIMIZE)

    # Budget constraint
    model.addConstr(S + O + SS + F == 3200000, name="budget")

    # Constraint 1: F <= S
    model.addConstr(F <= S, name="futures_stocks")

    # Constraint 2: F <= 0.35 * (S + O + SS + F)
    model.addConstr(F <= 0.35 * (S + O + SS + F), name="futures_percentage")

    # Constraint 3: O <= SS
    model.addConstr(O <= SS, name="options_swaps")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal Solution:")
        print(f"Stocks: {S.varValue}")
        print(f"Options: {O.varValue}")
        print(f"Security Swaps: {SS.varValue}")
        print(f"Futures: {F.varValue}")
        print(f"Max Return: {model.objVal}")
    else:
        print("No optimal solution found.")

if __name__ == "__main__":
    hedge_fund_optimization()
```