求解软件有,

matlab,lingo,商用软件

GLPK,GNU LP Kit,开源,ansi C

 

介绍图的匹配,matching

https://www.tutorialspoint.com/graph_theory/graph_theory_matchings.htm

最大流问题,有许多图的基础知识

https://blog.csdn.net/qq_39557517/article/details/81945749

介绍如何使用GLPK

https://www-sop.inria.fr/members/Frederic.Giroire/teaching/ubinet/pdfs/exercises-solvers.pdf

 

线性规划基本介绍:https://www.cs.cmu.edu/~ckingsf/bioinfo-lectures/linearp.pdf

线性规划三种求解方法:

Simplex method,单纯形法,古老的方法,虽然不是多项式时间算法,但实际计算很快;

Ellipsoid method,椭球方法,1970s提出,虽然是多项式时间算法,但实际效果差,很少用;

Interior point method,多项式时间算法,实用。

 

最大二分匹配,maximum bipartite matching

 

下面这个例子简单一些:

http://www.cs.cornell.edu/~tomf/pyglpk/ex_maxflow.html

与这个图类似:

混合整数线性规划,图的最大流,图的匹配,求解

对应的matlab线性规划代码如下,有一点需要注意PPT的目标函数是max,matlab目标函数是min:

clc;clear;
A = [  1,  0,  0,  0,  0;
       0,  1,  0,  0,  0;
       0,  0,  1,  0,  0;
       0,  0,  0,  1,  0;
       0,  0,  0,  0,  1
    ];
b = [4;1;2.5;1;4];
Aeq=[  1,  0, -1, -1,  0;
       0,  1,  1,  0, -1
    ];
beq = [0;0];

f = [-1,-1,0,0,0];

x = linprog(f,A,b,Aeq,beq)
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案