码迷,mamicode.com
首页 >  
搜索关键字:maxflow graph cuts    ( 3774个结果
算法导论——最小生成树:Kruskal算法(利用了并查集)
package org.loda.graph; import org.loda.structure.MinQ; import org.loda.structure.Queue; import org.loda.util.In; /** * * @ClassName: KruskalMST * @Description:Kruskal最小生成树算法 * @author...
分类:编程语言   时间:2015-05-26 06:54:36    阅读次数:168
区别 最短路跟最小生成树
首先是定义上 最小生成树能够保证整个拓扑图的所有路径之和最小,但不能保证任意两点之间是最短路径。 最短路径是从一点出发,到达目的地的路径最小。 实现方法 1. 最小生成树 最小生成树有两种算法来得到:Prims算法和Kruskal算法。 Kruskal算法:根据边的加权值以递增的方式,一次找出加权值最低的边来构建最小生成树,而且规定:每次添加的边不能造成生成树有回路,知道找...
分类:其他好文   时间:2015-05-25 11:29:02    阅读次数:274
算法导论——Kosaraju算法(强连通性)
package org.loda.graph; import org.loda.util.In; /** * * @ClassName: KosarajuSCC * @Description: Kosaraju强连通算法 * * 理解:原图g,逆后序order中如果a->b,那么反向图rg中如果也有a->b,表示这是...
分类:编程语言   时间:2015-05-25 01:03:13    阅读次数:251
算法导论——拓扑排序
package org.loda.graph; import org.loda.structure.Stack; import org.loda.util.In; /** * * @ClassName: Topological * @Description: 拓扑排序是所有节点dfs的逆后序,也就是每个节点任务完成的时间的逆...
分类:编程语言   时间:2015-05-24 20:28:47    阅读次数:161
算法导论——DFS深度优先搜索
package org.loda.graph; import org.loda.structure.Stack; /** * * @ClassName: DFS * @Description: 深度优先搜索(无向图) * @author minjun * @date 2015年5月24日 上午4:02:24 * */ public class...
分类:编程语言   时间:2015-05-24 08:59:08    阅读次数:176
Anonymizing the vertics
Although the techniques described above reveal the identity of the vertics in the social graph but add noise to the relationships between them,th...
分类:其他好文   时间:2015-05-21 22:18:02    阅读次数:141
图的表示javascript
乍一看,图和树或者二叉树很像,但是采用基于对象的方式来构建就会有问题,因为图可能会增长到非常大,用对象来表示就会使效率低下。          首先我们需要定义一个图的类,其中通过adj数组来表示邻接表,也就是与节点相关联的节点数组;marked数组则是用来表示该节点是否被访问过,是在深度优先搜索和广度优先搜索中用到的。 function Graph(v){//图类 this.vert...
分类:编程语言   时间:2015-05-21 09:09:21    阅读次数:135
【SPOJ】【Qtree】
QTREE - Query on a treeno tags You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3…N-1.We will ask you to perfrom some instructions of the following...
分类:其他好文   时间:2015-05-20 18:31:52    阅读次数:241
【LeetCode】Course Schedule II 解题报告
【题目】 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is exp...
分类:其他好文   时间:2015-05-19 19:09:54    阅读次数:134
【LeetCode】Course Schedule 解题报告
【题目】 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is exp...
分类:其他好文   时间:2015-05-19 19:08:51    阅读次数:177
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!