简体   繁体   English

Jung图库:如何基于顶点属性搜索顶点?

[英]Jung graph library: how to search vertices based on vertex property?

I am working with Jung framework to maintain and visualize my directed graph. 我正在使用Jung框架来维护和可视化我的有向图。 My vertex and edge are custom classes. 我的顶点和边线是自定义类。 In the vertex class I maintain a set of vertex properties like, tag, state, etc. 在顶点类中,我维护一组顶点属性,例如标签,状态等。

I need to search the graph for vertex with specific property. 我需要在图形中搜索具有特定属性的顶点。 For example, if a tag is given, i need to search the graph to find the vertex that hold that tag. 例如,如果给定标签,我需要搜索图形以找到保存该标签的顶点。 I am not sure how to do it efficiently. 我不确定如何有效地做到这一点。

any help? 有什么帮助吗?

JUNG does not, itself, maintain indexes of your vertex tags, because it doesn't know anything about them. JUNG本身不维护顶点标签的索引,因为它对它们一无所知。 You will need to construct and maintain your own indexes (eg, a Map from tag values to a set of vertices). 您将需要构造和维护自己的索引(例如,从标记值到一组顶点的映射)。

Note that this is not a JUNG-specific question at all, really. 请注意,这实际上根本不是针对JUNG的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM