
运筹学
通过代码实践,了解运筹学解决问题的过程。
TLetiking
终身学习者
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
运筹学实验_指派问题
#教学任务指派问题 import numpy as np from scipy.optimize import linear_sum_assignment #这个函数是用来求效率问题,也就是极小化问题 def printf(row_ind,col_ind,goodAt):#输出 print("最优解:") for i in range(len(row_ind)): print("x_{}{}=1".format(row_ind[i]+1,col_ind[i]+1),end原创 2021-06-28 01:00:50 · 1026 阅读 · 0 评论 -
运筹学实验_最短路径
运筹学实验四实验目的:实验要求:报告内容:Python实现:代码:Lingo实现:代码: 实验目的: python实现Dijkstra算法,lingo解决最短路问题 实验要求: 报告内容: Python实现: 代码: def startwith(start: int, mgraph: list) -> list: passed = [start] nopass = [x for x in range(len(mgraph)) if x != start] dis = mgrap原创 2021-06-28 00:56:42 · 1068 阅读 · 0 评论 -
运筹学实验_目标规划
运筹学实验三实验目的:实验要求:报告内容:Lingo实现:代码:Matlab实现:代码: 实验目的: Lingo实现层次算法、Matlab用线性规划包解目标规划问题 实验要求: 报告内容: Lingo实现: 代码: model: sets: level/1..3/:p,z,goal; variable/1..2/:x; h_con_num/1..2/:b; s_con_num/1..4/:g,dplus,dminus; h_con(h_con_num,variable):a; s_con(s_原创 2021-06-28 00:52:41 · 914 阅读 · 0 评论 -
运筹学实验_运输问题
实验目的: lingo实现运输问题、Matlab解决运输问题、Python调包实现 实验要求: 报告内容: Lingo实现: 代码: model: sets: supplys/1..3/: S; demands/1..4/: D; links(supplys, demands): c, x; endsets data: S = 7,4,9; D = 3,6,5,6; c = 3 11 3 10 1 9 2 8 7 4 10 5; enddata min = @sum(links原创 2021-06-28 00:44:07 · 1144 阅读 · 0 评论 -
运筹学实验_单纯形法
实验目的: python实现单纯形法、lingo实现灵敏度分析、对偶变量、人工变量 实验要求: 报告内容: python实现: 代码: import numpy as np from fractions import Fraction as f #本程序仅适用于标准形式的线性规划问题 #其中目标函数求最大,约束条件等式化,决策变量非负 #本程序实现的是单纯形法和大M法 def judge(matrix):#最优性检验 if max(matrix[-1][:-1]) <= 0:原创 2021-06-28 00:37:22 · 608 阅读 · 0 评论