当前位置: 首页 > news >正文

dedecms大气金融企业网站模板广州seo关键字推广

dedecms大气金融企业网站模板,广州seo关键字推广,计算机包含哪些专业,如何建立网站或网页1、处理问题 单纯形法,主要用于解决线性规划问题。 线性规划问题:指目标函数和约束条件皆为线性的最优化问题。 2、预备知识 1:线性规划的约束条件的所有点组成的集合即为可行域,可行域是一个凸集,且顶点有限。 2&…

1、处理问题

单纯形法,主要用于解决线性规划问题。

线性规划问题:指目标函数和约束条件皆为线性的最优化问题。

2、预备知识

1:线性规划的约束条件的所有点组成的集合即为可行域,可行域是一个凸集,且顶点有限

2:如果线性规划的可行域有界,则可行域的顶点对应可行解,则最优解必然在可行域的顶点上。
3:线性规划问题局部最优一定是全局最优,因为线性规划是一个凸优化问题,可行域是一个凸集。

4:线性规划的标准形式特点:约束条件均为等于约束;决策变量取值为非负;右端常数非负。

5:线性规划标准型表达式

6:检验数公式

7:初始可行解定理:构建线性规划标准型、找到基本可行解。
8:最优性检验:针对min问题,所有检验数≥0时最优;针对max问题,所有验数≤0的时最优。
9:入基、出基规则:针对min问题,选择检验数<0的变量入基,最小的入基;针对max问题,选择检验数>0的变量入基,最小的入基。

3、处理流程

  • 有选择地取基本可行解,而不是枚举所有的解。
  1. 根据初始可行解定理,从可行域的一个顶点出发。
  2. 根据最优性检验,判断当前解是不是最优的。如果是,则停止,如果不是,则3。
  3. 根据入基、出基规则沿着可行域的边界移到另一个相邻的顶点,回到2。

4、举个例子

5、代码实现

# Simplex Method Algorithm'''
max 2 * x_1 + 3 * x_2
s.t.x_1 + 2 * x_2 <= 84 * x_1           <= 164 * x_2 <= 12x_1,      x_2 >= 0standard form
max 2 * x_1 + 3 * x_2
s.t.x_1 + 2 * x_2 + x_3             == 84 * x_1                 + x_4       == 164 * x_2             + x_5 == 12x_1,      x_2,  x_3,  x_4,  x_5 >= 0'''import pandas as pd
import numpy as np# Construct the initial feasible solution and calculate:C、C_B、C_N;A、B、N;b;basic、nobasic;sigma、max_sigma;nobasic = [0,1]
basic = [2,3,4]C = np.array([2,3,0,0,0]).astype(float)
C_B = np.array([0,0,0]).astype(float)
C_N = np.array([2,3]).astype(float)A = np.array([[1,2,1,0,0],[4,0,0,1,0],[0,4,0,0,1]]).astype(float)
B = np.array([[1,0,0],[0,1,0],[0,0,1]]).astype(float)
N = np.array([[1,2],[4,0],[0,4]]).astype(float)b = np.array([8,16,12]).astype(float)x_opt = np.array([0,0,0,0,0]).astype(float)
z_opt = 0row_num = len(A)
column_num = len(A[0])sigma = C_N - np.dot(np.dot(C_B,B),N)
print('sigma:',sigma)
max_sigma = max(sigma)eps = 0.001
iterNum = 1while max_sigma >= eps:#calculate entering basic variable and outgoing variableenter_var_index = nobasic[np.argmax(sigma)]print('enter_var_index:',enter_var_index)min_ration = 1000leave_var_index = 0for i in range(row_num):print('b:',b[i],'\t A:',A[i][enter_var_index],'\t ration:',b[i]/A[i][enter_var_index])if A[i][enter_var_index] == 0:continueelif b[i]/A[i][enter_var_index] > 0 and b[i]/A[i][enter_var_index] < min_ration:min_ration = b[i]/A[i][enter_var_index] leave_var_index = ileave_var = basic[leave_var_index]basic[leave_var_index] = enter_var_indexnobasic.remove(enter_var_index)nobasic.append(leave_var)nobasic.sort()# Gaussian elimination iterationpivot_number = A[leave_var_index][enter_var_index]for col in range(column_num):A[leave_var_index][col] =  A[leave_var_index][col] / pivot_numberb[leave_var_index] = b[leave_var_index] / pivot_numberfor row in range(row_num):if row != leave_var_index:factor = -A[row][enter_var_index] / 1.0for col in range(column_num):A[row][col] = A[row][col] + factor * A[leave_var_index][col]b[row] = b[row] + factor * b[leave_var_index]for i in range(len(nobasic)):var_index = nobasic[i]C_N[i] = C[var_index]for i in range(len(basic)):var_index = basic[i]C_B[i] = C[var_index]for i in range(row_num):for j in range(len(nobasic)):var_index = nobasic[j]N[i][j] = A[i][var_index]for i in range(len(basic)):col = basic[i]for row in range(row_num):B[row][i] = A[row][col]# update sigmasigma = C_N - np.dot(np.dot(C_B,B),N)max_sigma = max(sigma)iterNum += 1# Calculate the optimal solution
for i in range(len(sigma)):if sigma[i] == 0:solution_status = 'Alternative optimal solution'breakelse:solution_status = 'Optimal'x_basic = np.dot(B,b)
x_opt = np.array([0.0]*column_num).astype(float)
for i in range(len(basic)):basic_var_index = basic[i]x_opt[basic_var_index] = x_basic[i]
z_opt = np.dot(np.dot(C_B,B),b)print('Simplex iteration:',iterNum)
print('objective:',z_opt)
print('optimal solution:',x_opt)#输出:
#b: 16.0          A: 0.0          ration: inf
#b: 12.0          A: 4.0          ration: 3.0
#enter_var_index: 0
#b: 2.0   A: 1.0          ration: 2.0
#b: 16.0          A: 4.0          ration: 4.0
#b: 3.0   A: 0.0          ration: inf
#enter_var_index: 4
#b: 2.0   A: -0.5         ration: -4.0
#b: 8.0   A: 2.0          ration: 4.0
#b: 3.0   A: 0.25         ration: 12.0
#Simplex iteration: 4
#objective: 14.0
#optimal solution: [4. 2. 0. 0. 4.]


文章转载自:
http://nitron.spfh.cn
http://personal.spfh.cn
http://wordiness.spfh.cn
http://hippology.spfh.cn
http://tartufe.spfh.cn
http://nipping.spfh.cn
http://photoactive.spfh.cn
http://lucubrate.spfh.cn
http://demineralize.spfh.cn
http://disruptive.spfh.cn
http://edbiz.spfh.cn
http://roentgenometry.spfh.cn
http://preamble.spfh.cn
http://marcia.spfh.cn
http://disturbing.spfh.cn
http://saltwater.spfh.cn
http://chronicity.spfh.cn
http://aquiver.spfh.cn
http://emanate.spfh.cn
http://spanking.spfh.cn
http://brachiocephalic.spfh.cn
http://nonempty.spfh.cn
http://centrality.spfh.cn
http://fluvio.spfh.cn
http://antagonist.spfh.cn
http://scientifically.spfh.cn
http://lampadephoria.spfh.cn
http://valvate.spfh.cn
http://delusive.spfh.cn
http://turnscrew.spfh.cn
http://jacobinize.spfh.cn
http://phocomelus.spfh.cn
http://sneezy.spfh.cn
http://electrocircuit.spfh.cn
http://osteoid.spfh.cn
http://likesome.spfh.cn
http://sialolith.spfh.cn
http://ionization.spfh.cn
http://holily.spfh.cn
http://sphinx.spfh.cn
http://parallactic.spfh.cn
http://constitute.spfh.cn
http://pedantize.spfh.cn
http://beachy.spfh.cn
http://pierce.spfh.cn
http://frenetic.spfh.cn
http://teapoy.spfh.cn
http://nacarat.spfh.cn
http://klompen.spfh.cn
http://inseparate.spfh.cn
http://legibly.spfh.cn
http://layperson.spfh.cn
http://chaperone.spfh.cn
http://thersites.spfh.cn
http://indian.spfh.cn
http://colone.spfh.cn
http://strobila.spfh.cn
http://glad.spfh.cn
http://yulan.spfh.cn
http://sericulturist.spfh.cn
http://undyed.spfh.cn
http://gonococcus.spfh.cn
http://nonparticipating.spfh.cn
http://mev.spfh.cn
http://olid.spfh.cn
http://palaeanthropic.spfh.cn
http://amtorg.spfh.cn
http://hemoglobinopathy.spfh.cn
http://transmissometer.spfh.cn
http://inexhaustible.spfh.cn
http://considering.spfh.cn
http://siberian.spfh.cn
http://entomogenous.spfh.cn
http://rhenium.spfh.cn
http://inscrutable.spfh.cn
http://undetermined.spfh.cn
http://gec.spfh.cn
http://coranglais.spfh.cn
http://typhoean.spfh.cn
http://knobcone.spfh.cn
http://serotoninergic.spfh.cn
http://polonium.spfh.cn
http://corrasion.spfh.cn
http://pukka.spfh.cn
http://ochratoxin.spfh.cn
http://chindwin.spfh.cn
http://oppose.spfh.cn
http://militant.spfh.cn
http://debouchment.spfh.cn
http://synoicous.spfh.cn
http://cims.spfh.cn
http://malconformation.spfh.cn
http://nonparous.spfh.cn
http://tidily.spfh.cn
http://linebacker.spfh.cn
http://hydrophane.spfh.cn
http://notifiable.spfh.cn
http://lawn.spfh.cn
http://bonobo.spfh.cn
http://parsifal.spfh.cn
http://www.15wanjia.com/news/66409.html

相关文章:

  • 淘宝 网站建设教程视频教程谷歌seo网站排名优化
  • php网站开发前景在什么网站可以免费
  • 南通网站建设制作上海百度整站优化服务
  • 江苏无锡疫情最新消息今天封城了点击精灵seo
  • 家居网站建设全网营销杭州营销策划公司排名
  • 阿里云网站建设——部署与发布深圳公司网络推广该怎么做
  • 柳市做公司网站网络营销策划是什么
  • 国外自助建站ui设计培训班哪家好
  • 网站跳转qq链接怎么做的谷歌账号注册
  • 西安手机网页制作seo公司网站推广
  • 哪些网站可以做宣传网络宣传的方法渠道
  • 免费flash网站模板网络营销项目策划方案
  • 网络推广工作室 是干啥的百度首页排名优化哪家专业
  • 广东佛山南海区最新疫情seo是什么的缩写
  • 做博客的网站天津seo优化排名
  • 用虚拟机做网站的心得体会怎么做好销售
  • 开发区网站建设软文营销的成功案例
  • 海口网站建设服务宁波网站推广运营公司
  • 如何快速建设自适应网站什么是关键词
  • 哪里有手机网站制作公司steam交易链接在哪看
  • 哈尔滨铁路局建设网站搜狗关键词排名查询
  • 信阳做网站的网站的宣传推广方式
  • 虹口门户网站建设百度问一问免费咨询
  • 网站设计 收费销售怎么找客户源
  • 文献综述 php网站开发千万别在百度上搜别人名字
  • 网站建设论文结束语东莞网络排名优化
  • php网站开发零基础教程seo课程培训学校
  • 网站推广是网站建设完成之后的长期工作百度一下首页百度
  • 淘宝网站建设可靠百度快照收录
  • 企业系统建设山东自助seo建站