In [14]:
using OPCSPs
step=5
max_nodes=30


Out[14]:
30

In [19]:
include("../src/solutions.jl")


Out[19]:
cheat (generic function with 1 method)

In [20]:
solns = [OPSolution() for i in 10:step:max_nodes]


Out[20]:
5-element Array{OPSolution,1}:
 OPSolution(nothing,nothing)
 OPSolution(nothing,nothing)
 OPSolution(nothing,nothing)
 OPSolution(nothing,nothing)
 OPSolution(nothing,nothing)

In [23]:
for (i,n) in enumerate(10:step:max_nodes)
    println("$n nodes")
    problem = gen_op(n_nodes=n, rng=MersenneTwister(n))
    @time solns[i] = solve_op(problem, initial = solns[i])
end


10 nodes
  0.003912 seconds (2.30 k allocations: 215.406 KB)
15 nodes
  0.641698 seconds (5.87 k allocations: 473.406 KB)
20 nodes
  1.859548 seconds (8.57 k allocations: 790.344 KB)
25 nodes
 22.365710 seconds (12.76 k allocations: 1.182 MB)
30 nodes
  5.931342 seconds (23.57 k allocations: 1.780 MB)

In [13]:
@show solns[1].u[7]
@show keys(solns[1].u)


solns[1].u[7] = 5.0
Out[13]:
Base.KeyIterator for a Dict{Tuple{Any},Float64} with 9 entries. Keys:
  (9,)
  (4,)
  (8,)
  (3,)
  (6,)
  (2,)
  (5,)
  (10,)
  (7,)
keys(solns[1].u) = Tuple{Any}[(9,),(4,),(8,),(3,),(6,),(2,),(5,),(10,),(7,)]

In [ ]:


In [7]:
# before u relaxation
for i in 10:step:max_nodes
    println("$i nodes")
    problem = gen_op(n_nodes=i, rng=MersenneTwister(i))
    @time solve_op(problem)
end


.894262 seconds (23.42 k allocations: 1.779 MB)
10 nodes
  0.007594 seconds (2.25 k allocations: 214.844 KB)
15 nodes
  1.109713 seconds (5.80 k allocations: 472.484 KB)
20 nodes
  1.101297 seconds (8.47 k allocations: 789.078 KB)
25 nodes
 60.534300 seconds (12.64 k allocations: 1.180 MB)
30 nodes
 13.321914 seconds (23.42 k allocations: 1.779 MB)

In [ ]:


In [ ]: