<p>Because you are talking about constraints, it appears you do not consider the case of inserting such &quot;access costs&quot; (because this is what they are) in the utility function. It implies that they do not create disutility directly, only direct or indirect monetary costs.</p>
<p>Let <span class="math-container">$d$</span> be the distance in some units. Let <span class="math-container">$C_d = c_dd$</span> be a linear (for simplicity) distance cost function,  where <span class="math-container">$c_d$</span> is the average cost per unit of distance. This cost may include fuel consumed, or opportunity costs of spending the time to go to the shop. It is realistic to also postulate the existence of a strictly non-zero minimum distance, <span class="math-container">$d_{min}$</span>, because the shops are not inside your house.</p>
<p>Your budget constraint now looks like (the undefined symbols have the usual meaning)</p>
<p><span class="math-container">$$\sum p_ix_i + c_dd \leq I,$$</span></p>
<p>while you also have the additional constraint <span class="math-container">$ d \geq d_{min}$</span>. So the Lagrangian is here</p>
<p><span class="math-container">$$U(\mathbf x) + \lambda \left(I-\sum p_ix_i - c_dd\right) + \mu(d- d_{min}),$$</span></p>
<p>with <span class="math-container">$\lambda, \mu$</span> being the non-negative Karush-Kuhn-Tucker multipliers. Your optimization problem involves maximizing the Lagrangian with respect to the <span class="math-container">$x_i$</span>s <em>and</em> with respect to <span class="math-container">$d$</span>.</p>
<p>One could specify reasonably a convex non-linear distance cost function. Finally, one could include <span class="math-container">$d$</span> in the utility function as generating directly disutility.</p>
<p>I guess you can take it from here.</p>
<p>Just note that with the formulation as above, you should obtain that at the solution, <span class="math-container">$\mu^* &gt;0$</span> meaning that the constraint will be binding and so you will always choose to go to the nearest shop... which aligns, at least in this case, with intuition (don't start thinking about shop/product differentiation, that would be a whole different situation).</p>

CC BY-SA 4.0
2020-10-25T20:23:52.070Z
Thanks a lot! I tried to build something very similar since I was working with perfect substitutes.
kala123
CC BY-SA 4.0
2020-10-25T21:45:34.577Z
but should we use di since there could be many shops ?
kala123
CC BY-SA 4.0
2020-10-25T22:44:24.077Z
@kala123 Yes we could.
Alecos Papadopoulos
CC BY-SA 4.0
2020-10-22T17:22:46.973Z
2020-10-22T17:22:46.973Z
Alecos Papadopoulos
<p>Everybody knows about budget constraints and how they are represented:</p>
<p><a href="https://i.sstatic.net/gyOnt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gyOnt.png" alt="enter image description here" /></a></p>
<p>but what if I want to represent a distance constrain from the shop you buy the goods?  How can I build that?</p>

CC BY-SA 4.0
2020-10-22T11:00:01.030Z
Depends on what kind of situation you are trying to capture/describe in your model. You can assume that shops locate along some geometric shape, line or circle or full blown grid, then people randomly populate the shape/area you can further then model some disutility from travelling or if you want explicitly limit distance of travel. Consider being bit more specific what kind of situation you are even trying to model.
1muflon1
CC BY-SA 4.0
2020-10-22T11:10:15.367Z
In order to simplify i was thinking about the KM from their homes
kala123
CC BY-SA 4.0
2020-10-22T11:12:12.777Z
but that does not help at all those are just units. Against you can have line, circle or grid where distances are measured in kilometers. You can just add units to elementary cartesian coordinate system and impose some restriction on absolute distance $\sqrt{x^2+y^2}$ traveled  - to be clear I am not saying you should do that that is just an example. Since I know nothing about the context of situation because it was not provided in your Q. Depending on different context different assumptions might be appropriate
1muflon1
CC BY-SA 4.0
2020-10-22T11:32:12.770Z
thanks for the help! i will see
kala123
<microeconomics><optimization>
How do you formulate a distance constraint and a budget constraint?
kala123
# How do you formulate a distance constraint and a budget constraint?

(Asked by: username_0 on 2020-10-22)

Everybody knows about budget constraints and how they are represented:

[![enter image description here](https://i.sstatic.net/gyOnt.png)](https://i.sstatic.net/gyOnt.png)

but what if I want to represent a distance constrain from the shop you buy the goods? How can I build that?

**Tags:** microeconomics, optimization

> **Comments:**
> **username_1**: Depends on what kind of situation you are trying to capture/describe in your model. You can assume that shops locate along some geometric shape, line or circle or full blown grid, then people randomly populate the shape/area you can further then model some disutility from travelling or if you want explicitly limit distance of travel. Consider being bit more specific what kind of situation you are even trying to model.  
> **username_0**: In order to simplify i was thinking about the KM from their homes  
> **username_1**: but that does not help at all those are just units. Against you can have line, circle or grid where distances are measured in kilometers. You can just add units to elementary cartesian coordinate system and impose some restriction on absolute distance $\sqrt{x^2+y^2}$ traveled  - to be clear I am not saying you should do that that is just an example. Since I know nothing about the context of situation because it was not provided in your Q. Depending on different context different assumptions might be appropriate  
> **username_0**: thanks for the help! i will see  

---

## 1 answers

### Answer by username_2 on 2020-10-22. Score: 5 | Accepted answer

Because you are talking about constraints, it appears you do not consider the case of inserting such "access costs" (because this is what they are) in the utility function. It implies that they do not create disutility directly, only direct or indirect monetary costs.

Let $d$ be the distance in some units. Let $C\_d = c\_dd$ be a linear (for simplicity) distance cost function, where $c\_d$ is the average cost per unit of distance. This cost may include fuel consumed, or opportunity costs of spending the time to go to the shop. It is realistic to also postulate the existence of a strictly non-zero minimum distance, $d\_{min}$, because the shops are not inside your house.

Your budget constraint now looks like (the undefined symbols have the usual meaning)

$$\sum p\_ix\_i + c\_dd \leq I,$$

while you also have the additional constraint $ d \geq d\_{min}$. So the Lagrangian is here

$$U(\mathbf x) + \lambda \left(I-\sum p\_ix\_i - c\_dd\right) + \mu(d- d\_{min}),$$

with $\lambda, \mu$ being the non-negative Karush-Kuhn-Tucker multipliers. Your optimization problem involves maximizing the Lagrangian with respect to the $x\_i$s *and* with respect to $d$.

One could specify reasonably a convex non-linear distance cost function. Finally, one could include $d$ in the utility function as generating directly disutility.

I guess you can take it from here.

Just note that with the formulation as above, you should obtain that at the solution, $\mu^\* >0$ meaning that the constraint will be binding and so you will always choose to go to the nearest shop... which aligns, at least in this case, with intuition (don't start thinking about shop/product differentiation, that would be a whole different situation).

> **Comments:**
> **username_0**: Thanks a lot! I tried to build something very similar since I was working with perfect substitutes.  
> **username_0**: but should we use di since there could be many shops ?  
> **username_2**: @username_0 Yes we could.  

---

