-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cycle policy condition on t #799
Comments
No. The correct approach is to use a graph with 16 nodes: julia> using SDDP
julia> graph = SDDP.LinearGraph(12);
julia> for t in 1:4
SDDP.add_node(graph, 12 + t)
p = t == 1 ? 0.95 : 1.0
SDDP.add_edge(graph, 11 + t => 12 + t, p)
end
julia> SDDP.add_edge(graph, 16 => 5, 1.0)
julia> graph
Root
0
Nodes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Arcs
0 => 1 w.p. 1.0
1 => 2 w.p. 1.0
2 => 3 w.p. 1.0
3 => 4 w.p. 1.0
4 => 5 w.p. 1.0
5 => 6 w.p. 1.0
6 => 7 w.p. 1.0
7 => 8 w.p. 1.0
8 => 9 w.p. 1.0
9 => 10 w.p. 1.0
10 => 11 w.p. 1.0
11 => 12 w.p. 1.0
12 => 13 w.p. 0.95
13 => 14 w.p. 1.0
14 => 15 w.p. 1.0
15 => 16 w.p. 1.0
16 => 5 w.p. 1.0 |
Thanks. |
It probably won't make that much of a difference. In an acyclic graph, the solution scales approximately linearly in the number of nodes. In a cyclic graph, I don't think anyone has a result, but I assume that it's the expected number of nodes in the forward pass. So 12 * (1 - p) is 240 nodes. Adding an extra 4 won't change much. |
I am working on an inventory problem, and I have some constraints that are just for the initial stages, but I'm using a cycle policy.
For example, imagine a problem with 12 nodes (or months) that I have a constraint that is different for the first 4 stages.
If I use the cycle policy this constraint will also appear after the initial 4 months, on months 13,14,15 and 16. If there is an way to detect the cycle then I could do something like this:
There is any flag for the subproblem to know that you are in cycle?
The text was updated successfully, but these errors were encountered: