Python在单纯形法教学中的应用
DOI:
CSTR:
作者:
作者单位:

洛阳师范学院数学科学学院,河南 洛阳 471934

作者简介:

刘华煜(1976—),硕士,讲师,研究方向:计算机应用,E-mail:liuhuayu76@outlook.com。

通讯作者:

中图分类号:

TP311

基金项目:


Application of Python in simplex method teaching
Author:
Affiliation:

Faculty of Mathematical Sciences, Luoyang Normal University, Luoyang, Henan 471934 , China

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    单纯形法是求解一般线性规划问题的基本方法,其求解步骤较多,单纯形表的构造与迭代过程较为复杂,是运筹学教学中的重点和难点。针对传统教学中学生难以直观理解单纯形表变化过程的问题,利用Python的矩阵计算和符号计算功能,设计了一种单纯形法求解过程的程序化演示方法。该方法以Excel文件为线性规划问题及单纯形表的输入、输出载体,结合NumPy,SymPy和Pandas等Python库,实现初始单纯形表构建、初始基可行解确定、检验数计算、换入基与换出基确定以及行变换等过程的自动化,并将每次迭代形成的单纯形表及相关决策过程输出至Excel文件。通过该方法,学生可以直观查看单纯形法的完整求解过程,加深对各个计算步骤及其逻辑关系的理解,从而提高单纯形法的学习效率。

    Abstract:

    The simplex method is regarded as a basic method for solving general linear programming problems. Its solving steps are numerous, and the construction and iterative process of the simplex tableau are relatively complex, so it is considered a key and difficult point in operations research teaching. To address the problem that the changing process of the simplex tableau is difficult for students to intuitively understand in traditional teaching, a programmed demonstration method for the solving process of the simplex method was designed by utilizing the matrix computation and symbolic computation functions of Python. In this method, Excel files are adopted as the input and output carriers of linear programming problems and simplex tableaus, and the automation of processes such as the construction of the initial simplex tableau, the determination of the initial basic feasible solution, the calculation of test numbers, the determination of entering and leaving basic variables, and row transformations is realized by combining Python libraries such as NumPy, SymPy, and Pandas. The simplex tableau formed in each iteration and the related decision-making process are output to Excel files. Through this method, the complete solving process of the simplex method can be intuitively viewed by students, the understanding of each calculation step and its logical relationships can be deepened, and thus the learning effect of the simplex method can be improved.

    参考文献
    相似文献
    引证文献
引用本文

刘华煜. Python在单纯形法教学中的应用[J].计算机应用文摘,2026,42(20):37-40

复制
分享
相关视频

文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2026-10-23
  • 出版日期:
文章二维码
关闭