Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
algorithms-lab-ss2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
algorithms-lab-ss2023
Commits
8496b426
Commit
8496b426
authored
1 year ago
by
Dominik Krupke
Browse files
Options
Downloads
Patches
Plain Diff
small fixes
parent
d9bafc4d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sheets/02_cpsat/DBST/README.md
+2
-3
2 additions, 3 deletions
sheets/02_cpsat/DBST/README.md
with
2 additions
and
3 deletions
sheets/02_cpsat/DBST/README.md
+
2
−
3
View file @
8496b426
...
...
@@ -42,7 +42,6 @@ Next, we have to make sure it actually obeys the rules as otherwise we just get
Let us start with some simple constraints that don't need much explanation:
*
Only one direction of an edge can be chosen: $
\f
orall
\{
v,w
\}\i
n E: x_{vw}+x_{wv}
\l
eq 1$ (see
`__forbid_bidirectional_edges`
)
*
We need to select $|V|-1$ edges for a tree: $
\s
um_{
\{
v,w
\}\i
n E}x_{vw}+x_{wv} = |V|-1$ (see
`__add_depth_constraints`
)
*
We set a random vertex $v_0$ as root and enforce that every other vertex has a parent.
*
$d_{v_0}=0$
*
$
\f
orall v
\n
ot= v_0
\i
n V:
\s
um_{w
\i
n Nbr(v)} x_{vw} =1$
...
...
@@ -57,7 +56,7 @@ Thus, if $x_{vw}=1$, $y\geq dist(v,w)$.
$$
\f
orall vw
\t
ext{ with }
\{
v, w
\}\i
n E: x_{vw}=1
\R
ightarrow y
\g
eq dist(v,w) $$
The objective will make sure that it is not larger than necessary, setting it equal to the most expensive selected edge.
See
`__add_bottleneck_constraints`
.
See
`__add_bottleneck_constraints`
for the implementation
.
#### Tree constraint
...
...
@@ -69,5 +68,5 @@ $$\forall v,w \in V: x_{vw} \Rightarrow d_w == d_v +1$$
A cycle would enforce that all vertices have an infite depth.
See
`__add_depth_constraints`
.
See
`__add_depth_constraints`
for the implementation
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment