- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
GraphGenerator<V,E, V>
The general egonet description that led to this implementation is described in the paper: Linton C. Freeman (1981), Centered Graphs and The Structure of Ego Networks.
The generator searches for paths from the given ego vertex to all vertices within the specified radius and generates a new graph containing the vertices found, along with the edges connecting them.
The distance of the vertices included on the resulting graph can be configured by using a custom radius, along with whether the new graph should include the original ego vertex and whether new edge objects should be used.
Note that this implementation works with undirected graphs by using the Breadth-First Shortest Path algorithm, and with directed graphs by using Dijkstra's Shortest Path algorithm.
- Author:
- Fotis Karagiannis
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault constructor ego inclusionstatic final intDefault constructor radiusstatic final booleanDefault constructor new edge usage -
Constructor Summary
ConstructorsConstructorDescriptionEgonetGraphGenerator(Graph<V, E> graph, V ego) EgonetGraphGenerator(Graph<V, E> graph, V ego, boolean includeEgo) EgonetGraphGenerator(Graph<V, E> graph, V ego, int radius) EgonetGraphGenerator(Graph<V, E> graph, V ego, int radius, boolean includeEgo) EgonetGraphGenerator(Graph<V, E> graph, V ego, int radius, boolean includeEgo, boolean newEdges) Constructor -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgrapht.generate.GraphGenerator
generateGraph
-
Field Details
-
DEFAULT_RADIUS
public static final int DEFAULT_RADIUSDefault constructor radius- See Also:
-
DEFAULT_INCLUDE_EGO
public static final boolean DEFAULT_INCLUDE_EGODefault constructor ego inclusion- See Also:
-
DEFAULT_USE_NEW_EDGES
public static final boolean DEFAULT_USE_NEW_EDGESDefault constructor new edge usage- See Also:
-
-
Constructor Details
-
EgonetGraphGenerator
public EgonetGraphGenerator(Graph<V, E> graph, V ego, int radius, boolean includeEgo, boolean newEdges) Constructor- Parameters:
graph- the given graphego- the ego vertex (must belong to the graph)radius- the limit on path lengthincludeEgo- include ego on the generated graph optionnewEdges- use new edge objects option
-
EgonetGraphGenerator
-
EgonetGraphGenerator
-
EgonetGraphGenerator
-
EgonetGraphGenerator
-
-
Method Details
-
generateGraph
Description copied from interface:GraphGeneratorGenerate a graph structure. The topology of the generated graph is dependent on the implementation. For graphs in which not all vertices share the same automorphism equivalence class, the generator may produce a labeling indicating the roles played by generated elements. This is the purpose of the resultMap parameter. For example, a generator for a wheel graph would designate a hub vertex. Role names used as keys in resultMap should be declared as public static final Strings by implementation classes.- Specified by:
generateGraphin interfaceGraphGenerator<V,E, V> - Parameters:
target- receives the generated edges and vertices; if this is non-empty on entry, the result will be a disconnected graph since generated elements will not be connected to existing elementsresultMap- if non-null, receives implementation-specific mappings from String roles to graph elements (or collections of graph elements)
-