Version:

harkmcp.gms : Models of Spatial Competition in MCP Form

**Description**

A spatial equilibrium model is used to demonstrate different ways of modeling market behavior. An earlier version (HARKER) used optimization to solve these problems. In this version, the problems are solved as complementarity problems.

**Small Model of Type :** MCP

**Category :** GAMS Model library

**Main file :** harkmcp.gms

```
$title Models of Spatial Competition in MCP Form (HARKMCP,SEQ=128)
$onText
A spatial equilibrium model is used to demonstrate different
ways of modeling market behavior. An earlier version (HARKER)
used optimization to solve these problems. In this version,
the problems are solved as complementarity problems.
Harker, P T, Alternative Models of Spatial Competition. Operations
Research 34, 3 (1986), 410-425.
Keywords: mixed complementarity problem, spatial equilibrium model, scenario
analysis, market behavior, competitive markets, monopolistic markets
$offText
Set
n 'nodes' / one, two, three, four, five, six /
l(n) 'regions' / one, two, three /;
Alias (l,lp), (n,np);
* Linear demand function: d(p) = (rho - p)/eta
* Linear marginal cost function: c(y) = alpha + 2*beta*y
Table coefs(l,*) 'demand and supply data'
alpha beta rho eta
one 1 0.5 19 0.2
two 2 0.4 27 0.01
three 1.5 0.3 30 0.3 ;
* The market is structured on a network. The total transport cost
* on the ij link is given by: tcij = kappaij*xij + nuij*xij^3
Table pairs(n,np,*) 'transport data'
kappa nu
one.four 1 .5
one.five 2 .2
two.six 3 .3
three.six 1 .4
four.one 2 .3
four.five 1 .1
four.six 1 .1
five.one 3 .5
five.four 2 .2
five.six 1 1.0
six.two 2 .25
six.three 2 .2
six.four 1 .9
six.five 3 .8 ;
Set arc(n,np) 'active arcs';
arc(n,np) = yes$pairs(n,np,"kappa");
Positive Variable
d(l) 'consumer demand'
c(n) 'marginal cost'
y(n) 'production'
x(n) 'total sales'
p(l) 'consumer price'
t(n,np) 'transport';
Equation
* Equations for basic model:
demand(l) 'inverse demand function (linear)'
supply(n) 'node balance condition'
mkt(l) 'market clearance'
mrmc(l) 'pricing equation'
tcost(n,np) 'transport cost equation'
cost(n) 'marginal cost of supply';
* Market structure flags:
Scalar
monopoly 'indicator for monopoly pricing' / 0 /
acp 'indicator for average cost pricing of transport' / 0 /;
* In these equations the associated variable is listed after the description.
* Inverse demand functions (d):
demand(l).. coefs(l,"eta")*d(l) =g= coefs(l,"rho") - p(l);
* Node balance (c):
supply(n).. y(n)$l(n) + sum(np$arc(np,n), t(np,n))
=g= x(n)$l(n) + sum(np$arc(n,np), t(n,np));
* Supply-demand balance (p):
mkt(l).. x(l) =g= d(l);
* Pricing equation relating marginal cost to consumer price (x):
mrmc(l).. c(l) =g= p(l) - (x(l)*coefs(l,"eta"))$monopoly;
* Transport activity zero profit condition (with adjustment depending
* on whether suppliers use average or marginal cost):
tcost(n,np)$arc(n,np).. c(n) + pairs(n,np,"kappa") + (3 - (2)$acp)
* pairs(n,np,"nu")*t(n,np)*t(n,np)
=g= c(np);
* Marginal cost equations:
cost(l).. coefs(l,"alpha") + 2*coefs(l,"beta")*y(l) =g= c(l);
* Define the model and the equation.variable associations:
Model harker / demand.d, supply.c, mkt.p, mrmc.x, tcost.t, cost.y /;
* Additional variables for oligopoly model:
Positive Variable
cc(l,n) 'cost of supply to node n by producer l'
xx(l,n) 'supply from producer l to market lp'
tt(l,n,np) 'shipments by producer l from node n to np';
* Revised equations for oligopoly model:
Equation
altsupply(l,n) 'node balance equation'
altmkt(l) 'demand balance'
altmrmc(lp,n) 'pricing equations'
alttcost(l,n,np) 'transport margins'
altcost(l) 'supply price equation'
tdef(n,np) 'total transport demand';
Set prd(l,n) 'indicator set for producer type l operating at node n';
prd(l,n) = no;
prd(l,l) = yes;
* Material balance:
altsupply(lp,n).. y(lp)$prd(lp,n) + sum(np$arc(np,n), tt(lp,np,n))
=g= xx(lp,n)$l(n) + sum(np$arc(n,np), tt(lp,n,np));
* Demand balance:
altmkt(l).. sum(lp, xx(lp,l)) =g= d(l);
* Pricing equation:
altmrmc(lp,l).. cc(lp,l) =g= p(l) - xx(lp,l)*coefs(l,"eta");
* Transport activity zero profit condition:
alttcost(l,n,np)$arc(n,np).. cc(l,n) + pairs(n,np,"kappa")
+ (3 - (2)$acp)*pairs(n,np,"nu")*t(n,np)*t(n,np)
=g= cc(l,np);
* Total transport demand (this equation and variable t is included in the
* monopoly model only to improve sparsity of the alttcost constraint).
tdef(n,np)$arc(n,np).. t(n,np) =e= sum(l, tt(l,n,np));
* Marginal cost of supply:
altcost(l).. coefs(l,"alpha") + 2*coefs(l,"beta")*y(l) =g= cc(l,l);
Model harkoli / demand.d, altsupply.cc, altmkt.p, altmrmc.xx, alttcost.tt, altcost.y, tdef.t /;
Parameter
rep1 'transport summary'
rep2 'supply demand and price summary';
t.l(n,np) = 0;
y.l(l) = 25;
x.l(n) = 1;
c.l(n) = 1;
d.l(l) = 1;
p.l(l) = 1;
t.fx(n,np) $(not arc(n,np)) = 0;
tt.fx(l,n,np)$(not arc(n,np)) = 0;
* Solve four alternative models, all based on the same data:
* 1. Classical spatial price equilibrium: perfectly competitive
* producers and suppliers facing average cost pricing of transportation:
monopoly = 0;
acp = 1;
solve harker using mcp;
rep1(n,np, "cspe2") = t.l(n,np);
rep2("supply",l,"cspe2") = y.l(l);
rep2("demand",l,"cspe2") = d.l(l);
rep2("price ",l,"cspe2") = p.l(l);
* 2. Monopoly pricing equilibrium in which the firm owns both
* means of production and distribution network (hence, marginal
* cost pricing prevails at both the factory and the railhead):
monopoly = 1;
acp = 0;
solve harker using mcp;
rep1(n,np, "monop1") = t.l(n,np);
rep2("supply",l,"monop1") = y.l(l);
rep2("demand",l,"monop1") = d.l(l);
rep2("price ",l,"monop1") = p.l(l);
* 3. Monopoly pricing equilibrium in which the firm uses the
* distribution network with average cost pricing:
monopoly = 1;
acp = 1;
solve harker using mcp;
rep1(n,np, "monop2") = t.l(n,np);
rep2("supply",l,"monop2") = y.l(l);
rep2("demand",l,"monop2") = d.l(l);
rep2("price ",l,"monop2") = p.l(l);
* 4. Multi-producer oligopoly model with average cost pricing
* of transportation links:
monopoly = 0;
acp = 1;
solve harkoli using mcp;
rep1(n,np, "oligop") = t.l(n,np);
rep2("supply",l,"oligop") = y.l(l);
rep2("demand",l,"oligop") = d.l(l);
rep2("price ",l,"oligop") = p.l(l);
* Compare the results from these computations with those
* which are reported by gams test problem harker.85 in which
* a consumer-producer surplus methods and a diagonalization
* algorithm use minos to solve the equilibrium system:
display rep1, rep2;
```