您的位置:首页 > 大数据 > 人工智能

2011-02-28 CLRS Chapter24 Single-Source Shortest Paths (下) 单源点最短路径 下

2011-03-05 15:29 357 查看

24.4 Difference constraints and shortest paths

In the general linear-programming problem, we are given an m × n matrix A, an m-vector b, and an n-vector c. We wish to find a vector xof n elements that maximizes the objective function 

 subject to the m constraints given by Ax ≤ b.
 
 
In a system of difference constraints, each row of the linear-programming matrix A contains one 1 and one -1, and all other entries of Aare 0. Thus, the constraints given by Ax ≤ b are a set of m difference constraints involving n unknowns, in which each constraint is a simple linear inequality of the form
xj - xi ≤ bk,
 
The idea is that in a system Ax ≤ b of difference constraints, the m × n linear-programming matrix A can be viewed as the transpose of an incidence matrix for a graph with n vertices and m edges.
 
 
Given a system Ax ≤ b of difference constraints, let G = (V, E) be the corresponding constraint graph. If G contains no negative-weight cycles, then
 

 

 

is a feasible solution for the system. If G contains a negative-weight cycle, then there is no feasible solution for the system.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  constraints each graph idea