# Problem with setting start value for PATH solver(PATH.jl) when solving a complementarity problem

**URL:** https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918
**Category:** Optimization (Mathematical)
**Tags:** jump
**Created:** [January 25, 2021, 4:30pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918 "2021-01-25T16:30:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jshengdb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jshengdb/32/21238_2.png) [@jshengdb](https://discourse.julialang.org/u/jshengdb)
#### Post date: [January 25, 2021, 4:30pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/1 "2021-01-25T16:30:03Z")

</div>

Hello,

I am now having a problem with setting initial value for PATH solver(PATH.jl). I am trying to solve a linear complementarity problem with a chosen initial point. The problem is following:

```julia
A = Dict(
    (1,1) => 1,
    (1,2) => 0.92941613,
    (2,1) => 3.58223173,
    (2,2) => 1,
)

b = Dict(
    1 => -7.66538265,
    2 => -12.0542,
)

ini_x = [86.35030320 89.894422]

m = Model(PATH.Optimizer)
@variable(m, 0 <= x[i = 1:2] <= 100, start = ini_x[i])
@constraint(m, defxDev[j in 1:2], sum(A[j,i]*x[i] for i in 1:2) + b[j] ⟂ x[j])

optimize!(m)

```

However, although I got a solution from solving this problem, it is not the solution achieved by using the initial point I choose. In fact, if I check the initial value of x, it will always be [50 50].

This will not be changed even if I use the

```julia
set_start_value()

```

function to set the initial value. Also, I will get the following warning message from the log output:

```julia
┌ Warning: MathOptInterface.VariablePrimalStart() is not supported by MathOptInterface.Bridges.LazyBridgeOptimizer{PATH.Optimizer{Float64}}. This information will be discarded.
└

```

I am wondering if I did something wrong when setting the initial value or the current JuMP didn’t support the setting start value for PATH solver(PATH.jl)?

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [January 25, 2021, 8:45pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/2 "2021-01-25T20:45:41Z")

</div>

This was my mistake. I’ve opened a PR to fix PATH.jl: [https://github.com/odow/PATH.jl/pull/13](https://github.com/odow/PATH.jl/pull/13)

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [January 25, 2021, 9:12pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/3 "2021-01-25T21:12:50Z")

</div>

I’ll try to register PATH.jl so it is available via `Pkg.add`: [https://github.com/JuliaRegistries/General/pull/28646](https://github.com/JuliaRegistries/General/pull/28646)

But for now, you should be able to get the new `master` by updating `import Pkg; Pkg.update("PATH")`.

---

<div class="post-metadata">

### Author: ![jshengdb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jshengdb/32/21238_2.png) [@jshengdb](https://discourse.julialang.org/u/jshengdb)
#### Post date: [January 26, 2021, 12:39am UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/4 "2021-01-26T00:39:27Z")

</div>

Thanks! This is exactly what I am looking for!

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [January 26, 2021, 8:11pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/5 "2021-01-26T20:11:53Z")

</div>

Just to follow up on this, PATH.jl has been archived and will no longer maintained.

Instead, [`PATHSolver.jl`](https://github.com/chkwon/PATHSolver.jl) v1.0 has been released and now contains the code from PATH.jl. (It was easier to do this because PATHSolver.jl was already registered, and it didn’t make sense to have two packages for PATH named PATH.jl and PATHSolver.jl.)

To switch, use:

```nohighlight
import Pkg; Pkg.rm("PATH"); Pkg.add("PATHSolver")

```

Then

```nohighlight
using JuMP, PATHSolver
model = Model(PATHSolver.Optimizer)

```

---

<div class="post-metadata">

### Author: ![jshengdb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jshengdb/32/21238_2.png) [@jshengdb](https://discourse.julialang.org/u/jshengdb)
#### Post date: [January 30, 2021, 5:11pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/6 "2021-01-30T17:11:43Z")

</div>

Thanks for doing this. I am trying to install the new PATHSolver.jl. However, I found that if I use the default setting:

```julia
Pkg.add("PATHSolver")

```

The old version v0.6.2 is installed instead of version v1.0.0. If I try to install the v1.0.0 by using following:

```julia
Pkg.add(Pkg.PackageSpec(name = "PATHSolver", version = v"1.0.0"))

```

The system will give the following information

```julia
  Resolving package versions...
Unsatisfiable requirements detected for package PATHSolver [f5f7c340]:
 PATHSolver [f5f7c340] log:
 ├─possible versions are: [0.5.0-0.5.2, 0.6.0-0.6.2, 1.0.0] or uninstalled
 ├─restricted to versions 1.0.0 by an explicit requirement, leaving only versions 1.0.0
 └─restricted by compatibility requirements with Complementarity [a9b2a840] to versions: [0.5.0-0.5.2, 0.6.0-0.6.2] — no versions left
   └─Complementarity [a9b2a840] log:
     ├─possible versions are: [0.5.0, 0.6.0, 0.7.0-0.7.2] or uninstalled
     └─restricted to versions * by an explicit requirement, leaving only versions [0.5.0, 0.6.0, 0.7.0-0.7.2]

```

I am wondering if there is now an issue in Julia to install PATHSolver.jl v1.0.0. Thanks

P.S.: I am now using Julia v1.5.3

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [January 31, 2021, 9:12pm UTC](https://discourse.julialang.org/t/problem-with-setting-start-value-for-path-solver-path-jl-when-solving-a-complementarity-problem/53918/7 "2021-01-31T21:12:23Z")

</div>

The error message is saying that you cannot use both PATHSolver.jl v1.0 and Complementarity.jl.

If you want to use the MPEC features of `Complementarity`, you will need to use PATHSolver 0.6.2.

If you just want to solve MCP with PATH, uninstall Complementarity with `import Pkg; Pkg.rm("Complementarity")`, then update `import Pkg; Pkg.update()`. Here’s an example of JuMP and PATHSolver: [https://github.com/chkwon/PATHSolver.jl#example-usage](https://github.com/chkwon/PATHSolver.jl#example-usage)
