• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EdgeBetweennessClusterer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer的典型用法代码示例。如果您正苦于以下问题:Java EdgeBetweennessClusterer类的具体用法?Java EdgeBetweennessClusterer怎么用?Java EdgeBetweennessClusterer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EdgeBetweennessClusterer类属于edu.uci.ics.jung.algorithms.cluster包,在下文中一共展示了EdgeBetweennessClusterer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: cluster

import edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer; //导入依赖的package包/类
public static void cluster(AggregateLayout<VisualNode,VisualEdge> layout, int numEdgesToRemove, boolean groupClusters) {
	
	Graph<VisualNode,VisualEdge> g = layout.getGraph();
	layout.removeAll();
	
	EdgeBetweennessClusterer<VisualNode,VisualEdge> clusterer = new EdgeBetweennessClusterer<VisualNode,VisualEdge>(numEdgesToRemove);
	Set<Set<VisualNode>> clusterSet = clusterer.transform(g);
	List<VisualEdge> edges = clusterer.getEdgesRemoved();
	
	int i = 0;
	//Clusters have same color
	for (Iterator<Set<VisualNode>> cIt = clusterSet.iterator(); cIt.hasNext();) {
	
		Set<VisualNode> vertices = cIt.next();
		Color c = similarColors[i % similarColors.length];
		
		colorCluster(vertices, c);
		if(groupClusters == true) {
			groupCluster(layout, vertices);
		}
		i++;
	}
}
 
开发者ID:pmanousis,项目名称:Hecataeus,代码行数:24,代码来源:VisualEdgeBetweennessClustering.java


示例2: clusterAndRecolor

import edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer; //导入依赖的package包/类
public void clusterAndRecolor(SubLayoutDecorator layout,
	int numEdgesToRemove,
	Color[] colors, boolean groupClusters) {
	//Now cluster the vertices by removing the top 50 edges with highest betweenness
	//		if (numEdgesToRemove == 0) {
	//			colorCluster( g.getVertices(), colors[0] );
	//		} else {
	
	Graph g = layout.getGraph();
       layout.removeAllSubLayouts();

	EdgeBetweennessClusterer clusterer =
		new EdgeBetweennessClusterer(numEdgesToRemove);
	ClusterSet clusterSet = clusterer.extract(g);
	List edges = clusterer.getEdgesRemoved();

	int i = 0;
	//Set the colors of each node so that each cluster's vertices have the same color
	for (Iterator cIt = clusterSet.iterator(); cIt.hasNext();) {

		Set vertices = (Set) cIt.next();
		Color c = colors[i % colors.length];

		colorCluster(vertices, c);
		if(groupClusters == true) {
			groupCluster(layout, vertices);
		}
		i++;
	}
	for (Iterator it = g.getEdges().iterator(); it.hasNext();) {
		Edge e = (Edge) it.next();
		if (edges.contains(e)) {
			e.setUserDatum(DEMOKEY, Color.LIGHT_GRAY, UserData.REMOVE);
		} else {
			e.setUserDatum(DEMOKEY, Color.BLACK, UserData.REMOVE);
		}
	}

}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:40,代码来源:ClusteringDemo.java


示例3: compute

import edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer; //导入依赖的package包/类
/**
 * 
 * @param fraction -- the fraction of edges that should be removed. If set to 
 * {@value 0.0} then a default value of {@value 0.3}, i.e., 
 * {@value 30%} will be used.
 */
public void compute(double fraction) {
  int edgeCount = jungGraph.getEdgeCount();
  EdgeBetweennessClusterer<Integer, Integer> computer = 
      new EdgeBetweennessClusterer<>((int)(edgeCount * fraction));
  
  this.communities = computer.transform(jungGraph);
}
 
开发者ID:spideruci,项目名称:cerebro-layout,代码行数:14,代码来源:JungCommunityComputer.java


示例4: clusterAndRecolor

import edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer; //导入依赖的package包/类
public void clusterAndRecolor(AggregateLayout<Number,Number> layout,
	int numEdgesToRemove,
	Color[] colors, boolean groupClusters) {
	//Now cluster the vertices by removing the top 50 edges with highest betweenness
	//		if (numEdgesToRemove == 0) {
	//			colorCluster( g.getVertices(), colors[0] );
	//		} else {
	
	Graph<Number,Number> g = layout.getGraph();
       layout.removeAll();

	EdgeBetweennessClusterer<Number,Number> clusterer =
		new EdgeBetweennessClusterer<Number,Number>(numEdgesToRemove);
	Set<Set<Number>> clusterSet = clusterer.transform(g);
	List<Number> edges = clusterer.getEdgesRemoved();

	int i = 0;
	//Set the colors of each node so that each cluster's vertices have the same color
	for (Iterator<Set<Number>> cIt = clusterSet.iterator(); cIt.hasNext();) {

		Set<Number> vertices = cIt.next();
		Color c = colors[i % colors.length];

		colorCluster(vertices, c);
		if(groupClusters == true) {
			groupCluster(layout, vertices);
		}
		i++;
	}
	for (Number e : g.getEdges()) {

		if (edges.contains(e)) {
			edgePaints.put(e, Color.lightGray);
		} else {
			edgePaints.put(e, Color.black);
		}
	}

}
 
开发者ID:marcvanzee,项目名称:mdp-plan-revision,代码行数:40,代码来源:ClusteringDemo.java


示例5: obtainGraphClusterer

import edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected GraphClusterer obtainGraphClusterer() {
	return new EdgeBetweennessClusterer(numberOfEdges);
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:6,代码来源:EdgeBetweennessCommunityClusterer.java



注:本文中的edu.uci.ics.jung.algorithms.cluster.EdgeBetweennessClusterer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectDeletedEvent类代码示例发布时间:2022-05-22
下一篇:
Java PermissionManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap