I'm trying to formulate the following equations: 25, 28, 29, 30 & 31, with Pulp in Python using dictionaries that include LpVariable, with the objective to minimize the end to end latency of a transmission from one network node to node.
- i index refers to a specific type of transmission flow
- k index refers to a frame within a flow
- Vx, Va, Vb are nodes in the network with this topology (Vx <--> Va <--> Vb)
Equations:
Currently I am figuring out how to set the 29th constraint so, in my mind it should look like:
model = LpProblem(name="ilp", sense=LpMinimize)
I = range(2)
K = range(4)
offsets = {i: LpVariable(name=f"offset_{i}", lowBound=lowBounds[i]) for i in I}
e2e_lat = {}
e2e_lat_lowBound = {}
for i in I:
for k in K:
e2e_lat[i] = offsets[i, k] + t_tx[i, k] - offsets[i, 1]
e2e_lat_lowBound[i] = offsets[i, k].lowBound + t_tx[i, k]
for i in I:
model += e2e_lat[i] == deadline[i]
#Objective
model += c2 * lpSum([e2e_lat[i] - e2e_lat_lowBound[i] for i in I])
Since I'm new to linear programming I have no clue to how it should be coded.
I would be really grateful for any help.