Skip to content

Commit 67466d3

Browse files
authored
Upd
1 parent 7fe3878 commit 67466d3

File tree

1 file changed

+1
-1
lines changed
  • C24-Single-Source-Shortest-Paths

1 file changed

+1
-1
lines changed

C24-Single-Source-Shortest-Paths/24.4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ elements of b are real-valued and all of the unknowns xi must be integers.
125125
Give an efficient algorithm to solve a system Ax ≤ b of difference constraints when all of the elements of b are real-valued and a specified subset of some, but not necessarily all, of the unknowns xi must be integers.
126126

127127
### `Answer`
128-
仍然采用最短路径算法,在松弛过程中,取 v.d = {(u.d + w(u, v)) 向下取整}。
128+
仍然采用最短路径算法,在松弛过程中,若有必要(x.v为整数),取 v.d = {(u.d + w(u, v)) 向下取整}。
129129
证明:
130130
假设这个算法得出的解(最短路径)不满足约束条件,更具体的,xi - xj > bm。
131131
因为我们在松弛过程中,由于向下取整,导致实际取的 v.d ≤ u.d + w(u, v),而如果取 v.d = u.d + w(u, v) 结果是满足约束条件的,可知一定是j点得最短路径取小了。

0 commit comments

Comments
 (0)