## Problem Description and Formulation

The problem is a classic example of a linear programming problem. Nova Network wants to maximize its profit by determining the optimal number of ring, tree, and mesh layouts to build given the available resources (workstations, servers, and switches).

Let's define the decision variables:

- $R$ = number of ring layouts
- $T$ = number of tree layouts
- $M$ = number of mesh layouts

The objective function to maximize the profit is:

\[ \text{Maximize:} \quad 2000R + 4000T + 8000M \]

Subject to the constraints:

1. Workstations: $50R + 30T + 100M \leq 2000$
2. Servers: $20R + 15T + 50M \leq 500$
3. Switches: $10R + 7T + 30M \leq 300$
4. Non-negativity: $R \geq 0, T \geq 0, M \geq 0$

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    R = model.addVar(lb=0, name="R")  # ring layout
    T = model.addVar(lb=0, name="T")  # tree layout
    M = model.addVar(lb=0, name="M")  # mesh layout

    # Objective function: Maximize profit
    model.setObjective(2000*R + 4000*T + 8000*M, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(50*R + 30*T + 100*M <= 2000, name="workstations")
    model.addConstr(20*R + 15*T + 50*M <= 500, name="servers")
    model.addConstr(10*R + 7*T + 30*M <= 300, name="switches")

    # Optimize the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal Solution:")
        print(f"Ring Layouts: {R.varValue}")
        print(f"Tree Layouts: {T.varValue}")
        print(f"Mesh Layouts: {M.varValue}")
        print(f"Maximum Profit: {model.objVal}")
    else:
        print("The model is infeasible")

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