随笔分类 -  [Algorithm]

摘要:最小生成树生成算法 【申明】以下内容转载自:http://squirrelrao.iteye.com/blog/1044867Prim算法和Kruskal算法都能从连通图找出最小生成树。区别在于Prim算法是挨个找,而Kruskal是先排序再找。一、Prim算法:Prim算法实现的是找出一个有权重连通图中的最小生成树,即:具有最小权重且连接到所有结点的树。(强调的是树,树是没有回路的)。Prim算法是这样来做的:首先以一个结点作为最小生成树的初始结点,然后以迭代的方式找出与最小生成树中各结点权重最小边,并加入到最小生成树中。加入之后如果产生回路则跳过这条边,选择下一个结点。当所有结点都加入到最 阅读全文
posted @ 2014-04-10 14:59 此间漫步 阅读(236) 评论(0) 推荐(0)
摘要:The solution of Ax=b A is matrix whose size is m-by-n, b is a n-by-1 column vector. The solution x is a n-by-1 column vectorMldivide is a matlab function, which is also denoted as"\". It solve systems of linear equations Ax = B for x. The method is called left divide., The A-1 is on the le 阅读全文
posted @ 2014-03-26 20:29 此间漫步 阅读(342) 评论(0) 推荐(0)
摘要:The solution of Ax=b Mldivide is a matlab function, which is also denoted as"\". It solve systems of linear equations Ax = B for x. The method is called left divide., The A-1 is on the left of b, this is the reason called left divide. But the A-1 exists only when A is a square matrix. When 阅读全文
posted @ 2014-03-26 18:01 此间漫步 阅读(460) 评论(0) 推荐(0)