数学建模层次分析法旅游景点选址举例
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
假期到了, 某学生打算做一次旅游, 有四个地点可供选择, 假定他要考虑5个因素: 费用、景色、居住条件、饮食以及旅游条件. 由于该学生没有固定收入, 他对费用最为看重, 其次是旅游点的景色, 至于旅游条件、饮食, 差不多就行, 住什么地方就更无所谓了. 这四个旅游点没有一个具有明显的优势, 而是各有优劣. 该同学拿不定主意, 请用层次分析法帮助他找出最佳旅游点。 正文:
1、利用层次分析法构造层次分析模型:
图1-1
2、利用成对比较法对准则层、方案层进行列表
费用对比
(表2-3)
(表2-4)
(表2-5)
旅游条件对比
2.构造成对比较判断矩阵
(1) 建立准则层对目标层的成对比较判断矩阵
1
53931/511/221/21/321311/91/21/311/31/32131A ⎡⎤⎢⎥⎢⎥⎢⎥=⎢⎥⎢⎥⎢⎥⎣⎦
(2) 建立方案层对准则层的成对比较判断矩阵
111/31/51/7311/21/45211/21/7421B ⎛⎫ ⎪ ⎪= ⎪ ⎪⎝⎭211/24
321551/41/5111/31/511B ⎛⎫
⎪ ⎪= ⎪ ⎪⎝⎭
31
6581/61121/51171/81/21/71B ⎛⎫
⎪
⎪= ⎪
⎪⎝⎭ 4111/31/3111/21/532113511B ⎛⎫ ⎪ ⎪= ⎪
⎪⎝⎭ 5
121
21/211/2112121/211/21B ⎛⎫
⎪
⎪
= ⎪ ⎪
⎝⎭
3.计算层次单排序权重向量并做一致性检验
先利用Mathematica 计算矩阵A 的最大特征值及特征值所对应的特征向量. 输入
A={{1.0,5,3,9,3},{1/5,1,1/2,2,1/2},{1/3,2,1,3,1},{1/9,1/2,1/3,1,1/3},{1/3,2,1,3,1}} T=Eigensystem[j]//Chop 输出
{{5.00974,-0.0048699+0.22084™,-0.0048699-0.22084™,0,0}, {{0.88126,0.167913,0.304926,0.0960557,0.304926},
{0.742882,-0.223286-0.278709™,-0.165421+0.346134™,0.151384-0.057689™,-0.165421+0.346134™},
{0.742882,-0.223286+0.278709™,-0.165421-0.346134™,0.151384+0.057689™,-0.165421-0.346134™},
{-0.993367,0,0.0719207,0.0662245,0.0605282}, {0.884443,0,-0.380934,-0.0589629,0.263009}}}
得出A 的最大特征值为
max λ=5.00974,
及其对应的特征向量x={0.88126,0.167913,0.304926,0.0960557,0.304926}T
输入
Clear[x]; x=T[[2,1]];
W1=x/Apply[Plus,x]
得到归一化之后的的特征向量
()1w ={0.502119,0.0956728,0.173739,0.0547301,0.173739}T
计算一致性指标max 1
n
CI n λ-=
-, ,00974.5,5m ax ==λn 故
.002435.0=CI
查表(见表3-1)得到相应的随机一致性指标 1.12RI =
所以 002174.0)
2(==
RI
CI
CR ()20.1CR <通过了一致性检验,即认为A 的一致性程度在容许的范围之内, 可以用归一
化后的特征向量()
1w 作为排序权重向量.
下面再求矩阵)5,,2,1( =j B j 的最大特征值及特征值所对应的特征向量 输入
B1={{1.0,1/3,1/5,1/7},{3,1,1/2,1/4},{5,2,1,1/2},{1/7,4,2,1}} B2={{1,1/2,4,3},{2,1,5,5},{1/4,1/5,1,1},{1/3,1/5,1,1}} B3={{1,6,5,8},{1/6,1,1,2},{1/5,1,1,7},{1/8,1/2,1/7,1}} B4={{1,1,1/3,1/3},{1,1,1/2,1/5},{3,2,1,1},{3,5,1,1}} B5={{1,2,1,2},{1/2,1,1/2,1},{1,2,1,2},{1/2,1,1/2,1}} T1=Eigensystem[B1]//Chop T2=Eigensystem[B2]//Chop T3=Eigensystem[B3]//Chop T4=Eigensystem[B4]//Chop T5=Eigensystem[B5]//Chop 输出
{{3.82325,0.0883772+0.544064™,0.0883772-0.544064™,0}, {{0.111267,0.283002,0.536902,0.786934},
{-0.0248134-0.0681165™,-0.141793+0.0729826™,-0.154388+0.121345™,0.964755}, {-0.0248134+0.0681165™,-0.141793-0.0729826™,-0.154388-0.121345 ™,0.964755}, {0,0.299667,-0.832409,0.466149}}}
{{4.02113,-0.0105652+0.291301™,-0.0105652-0.291301™,0}, {{0.495852,0.84036,0.149575,0.159851},
{-0.234515+0.517899™,0.805208,-0.109665-0.110941™,0.0407277 -0.0493071 ™}, {-0.234515-0.517899 ™,0.805208,-0.109665+0.110941 ™,0.0407277 +0.0493071 ™}, {0,-0.953463,-0.0953463,0.286039}}}
{{4.25551,-0.110262+1.03317™,-0.110262-1.03317™,-0.0349818}, {{0.941183,0.179553,0.276018,0.0758271},
{0.898054,0.136097 +0.0728034 ™,-0.309669+0.2519 ™,-0.0331642-0.0960598™}, {0.898054,0.136097-0.0728034™,-0.309669-0.2519™,-0.0331642+0.0960598™}, {0.958653,-0.256222,0.123505,-0.00904772}}}
{{4.08009,-0.0400469+0.570251™,-0.0400469-0.570251™,0}, {{0.214349,0.214031,0.59059,0.747963},
{0.00228339-0.0861419™,-0.0895045+0.220107™,-0.388206-0.387638™,0.796962}, {0.00228339+0.0861419™,-0.0895045-0.220107™,-0.388206+0.387638 ™,0.796962}, {-0.424264,0,0.565685,0.707107}}}
{{4.,0,0,0},