wujiao.m是五角星去交叉程序,用于使求出的tsp去交叉,应用见我上载的ant-tsp-elimcross程序 nixu.m是wujiao.m求逆序的测试程序
上传时间: 2015-09-18
上传用户:pinksun9
排列问题 M个1,N个0的排列(高效率版) 排列数为:c(m+n,n) 对n个0,m个1,我的想法是这样的: 每个排列可以分三段: 全0列,全1列, 子问题列 设各段长:r,s,t .子问题列就是 (n,m) = (n-r,m-s),其中0<=r<=n,s=1
上传时间: 2015-11-11
上传用户:1051290259
[输入] 图的顶点个数N,图中顶点之间的关系及起点A和终点B [输出] 若A到B无路径,则输出“There is no path” 否则输出A到B路径上个顶点 [存储结构] 图采用邻接矩阵的方式存储。 [算法的基本思想] 采用广度优先搜索的方法,从顶点A开始,依次访问与A邻接的顶点VA1,VA2,...,VAK, 访问遍之后,若没有访问B,则继续访问与VA1邻接的顶点VA11,VA12,...,VA1M,再访问与VA2邻接顶点...,如此下去,直至找到B,最先到达B点的路径,一定是边数最少的路径。实现时采用队列记录被访问过的顶点。每次访问与队头顶点相邻接的顶点,然后将队头顶点从队列中删去。若队空,则说明到不存在通路。在访问顶点过程中,每次把当前顶点的序号作为与其邻接的未访问的顶点的前驱顶点记录下来,以便输出时回溯。 #include<stdio.h> int number //队列类型 typedef struct{ int q[20]
标签: 输入
上传时间: 2015-11-16
上传用户:ma1301115706
the calculator s usage! after you have inputed 2 operators,choose + - * / function! But the only situation I did t deal with is that when you choos + fuction ,and the operaters signs is like this -A+B,just turn it to B-A!
标签: calculator the operators function
上传时间: 2016-02-12
上传用户:lili123
运动会分数统计 参加运动会的n个学校编号为1~n。比赛分成m个男子项目和w个女子项目,项目编号分别为1~m和m+1~m+w。由于各项目参加人数差别较大,有些项目取前五名,得分顺序为7,5,3,2,1;还有些项目只取前三名,得分顺序为5,3,2。写一个统计程序产生各种成绩单和得分报表
上传时间: 2016-03-23
上传用户:zhuyibin
图的深度遍历,输出结果为(红色为键盘输入的数据,权值都置为1): 输入顶点数和弧数:8 9 输入8个顶点. 输入顶点0:a 输入顶点1:b 输入顶点2:c 输入顶点3:d 输入顶点4:e 输入顶点5:f 输入顶点6:g 输入顶点7:h 输入9条弧. 输入弧0:a b 1 输入弧1:b d 1 输入弧2:b e 1 输入弧3:d h 1 输入弧4:e h 1 输入弧5:a c 1 输入弧6:c f 1 输入弧7:c g 1 输入弧8:f g 1 深度优先遍历: a b d h e c f g 程序结束.
标签:
上传时间: 2016-04-04
上传用户:lht618
CRC16算法的Java实现,使用方法如下: CRC16 crc16 = new CRC16() byte[] b = new byte[] { // (byte) 0xF0,(byte)0xF0,(byte)0xF0,(byte)0x72 (byte) 0x2C, (byte) 0x00, (byte) 0xFF, (byte) 0xFE, (byte) 0xFE, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 } for (int k = 0 k < b.length k++) { crc16.update(b[k]) } System.out.println(Integer.toHexString(crc16.getValue())) System.out.println(Integer.toHexString(b.length))
上传时间: 2014-12-20
上传用户:ve3344
内含Newtonback.m,Newtonforward.m文件,牛顿插值法,向前向后插值。
标签: Newtonback
上传时间: 2014-01-05
上传用户:refent
GPS系统接收数据坐标转换 GPS接收的数据往往是三维坐标,而在科学研究中我们通常用二维坐标。因此必须 进行坐标转换,下面我们介绍一种坐标转换,即把WGS84坐标转换为高斯—克吕 格坐标系。数字地图投影的方法很多,而我国采用了高斯—克吕格投影,它是一 种横轴椭园柱面等角投影,用一个椭球柱面与地球椭球在某一子午圈L0上相切, 这条子午线通常称做投影轴子午线。也就是高斯-克吕格投影直角坐标系的x 轴, 地球的赤道与椭圆柱面相交, 成一直线,这条直线与轴子午线正交,就是平面直角坐 标系的y轴,把椭球柱面展开,就得到以(x,y)为坐标的平面直角坐标系。为减少 投影变形,按经度把椭球分为许多带,各带分别投影,经常采用的是3度和6度带。 为使y值不为负值,通常在y轴上加上500km。 已知WGS84坐标(B,L),B为GPS定位输出成果的纬度,L为GPS定位输出成果的经度。 由WGS84到高斯-克吕格坐标(x,y)的转换成高斯投影正算,详见本软件
上传时间: 2014-01-26
上传用户:小眼睛LSL
The package includes 3 Matlab-interfaces to the c-code: 1. inference.m An interface to the full inference package, includes several methods for approximate inference: Loopy Belief Propagation, Generalized Belief Propagation, Mean-Field approximation, and 4 monte-carlo sampling methods (Metropolis, Gibbs, Wolff, Swendsen-Wang). Use "help inference" from Matlab to see all options for usage. 2. gbp_preprocess.m and gbp.m These 2 interfaces split Generalized Belief Propagation into the pre-process stage (gbp_preprocess.m) and the inference stage (gbp.m), so the user may use only one of them, or changing some parameters in between. Use "help gbp_preprocess" and "help gbp" from Matlab. 3. simulatedAnnealing.m An interface to the simulated-annealing c-code. This code uses Metropolis sampling method, the same one used for inference. Use "help simulatedAnnealing" from Matlab.
标签: Matlab-interfaces inference interface the
上传时间: 2016-08-27
上传用户:gxrui1991