2019年12月2日

无向图 六度人脉 门口的野张三能认识藏在深处的赵六吗?

摘要: 主要使用的广度优先,从给定起点,求得到可达点的最短路径成本 public class FriendDegree { Graph g; int s; int[] degrees; boolean[] marked; int maxDegree; LinkedList<Integer> maxDegre 阅读全文

posted @ 2019-12-02 22:11 jald 阅读(151) 评论(0) 推荐(0) 编辑

有向图-可达性分析

摘要: 图的数据结构常用邻接矩阵或邻接表来表示 这里用邻接表来实现一个有向图 顶点链表节点(邻接表) public class Vertex { public int v; //当前顶点编号 public Vertex n; //指向的下一个顶点对象 public Vertex(int v) { this. 阅读全文

posted @ 2019-12-02 21:47 jald 阅读(744) 评论(0) 推荐(0) 编辑

导航