Package com.powsybl.openloadflow.graph
Class EvenShiloachGraphDecrementalConnectivity<V,E>
- java.lang.Object
-
- com.powsybl.openloadflow.graph.AbstractGraphConnectivity<V,E>
-
- com.powsybl.openloadflow.graph.EvenShiloachGraphDecrementalConnectivity<V,E>
-
- All Implemented Interfaces:
GraphConnectivity<V,E>
public class EvenShiloachGraphDecrementalConnectivity<V,E> extends AbstractGraphConnectivity<V,E>
Implementing the Even-Shiloach algorithm (see https://dl.acm.org/doi/10.1145/322234.322235) Due to time computation optimizations, this current implementation is only for graphs which initially have ONLY ONE connected component. If more, an exception is thrown.- Author:
- Geoffroy Jamgotchian
, Florian Dupuy
-
-
Field Summary
-
Fields inherited from class com.powsybl.openloadflow.graph.AbstractGraphConnectivity
componentSets
-
-
Constructor Summary
Constructors Constructor Description EvenShiloachGraphDecrementalConnectivity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<V>
getConnectedComponent(V vertex)
Return the connected component set of given vertexSet<V>
getNonConnectedVertices(V vertex)
protected int
getQuickComponentNumber(V vertex)
protected void
resetConnectivity(Deque<GraphModification<V,E>> m)
void
startTemporaryChanges()
Start recording topological changes to undo them later by aGraphConnectivity.undoTemporaryChanges()
call.protected void
updateComponents()
protected void
updateConnectivity(EdgeAdd<V,E> edgeAdd)
protected void
updateConnectivity(EdgeRemove<V,E> edgeRemoval)
protected void
updateConnectivity(VertexAdd<V,E> vertexAdd)
-
Methods inherited from class com.powsybl.openloadflow.graph.AbstractGraphConnectivity
addEdge, addVertex, checkSaved, checkVertex, getComponentNumber, getEdgesAddedToMainComponent, getEdgesRemovedFromMainComponent, getGraph, getModificationsContexts, getNbConnectedComponents, getSmallComponents, getVerticesAddedToMainComponent, getVerticesRemovedFromMainComponent, removeEdge, setMainComponentVertex, undoTemporaryChanges
-
-
-
-
Method Detail
-
updateConnectivity
protected void updateConnectivity(EdgeRemove<V,E> edgeRemoval)
- Specified by:
updateConnectivity
in classAbstractGraphConnectivity<V,E>
-
updateConnectivity
protected void updateConnectivity(EdgeAdd<V,E> edgeAdd)
- Specified by:
updateConnectivity
in classAbstractGraphConnectivity<V,E>
-
updateConnectivity
protected void updateConnectivity(VertexAdd<V,E> vertexAdd)
- Specified by:
updateConnectivity
in classAbstractGraphConnectivity<V,E>
-
resetConnectivity
protected void resetConnectivity(Deque<GraphModification<V,E>> m)
- Specified by:
resetConnectivity
in classAbstractGraphConnectivity<V,E>
-
updateComponents
protected void updateComponents()
- Specified by:
updateComponents
in classAbstractGraphConnectivity<V,E>
-
startTemporaryChanges
public void startTemporaryChanges()
Description copied from interface:GraphConnectivity
Start recording topological changes to undo them later by aGraphConnectivity.undoTemporaryChanges()
call.- Specified by:
startTemporaryChanges
in interfaceGraphConnectivity<V,E>
- Overrides:
startTemporaryChanges
in classAbstractGraphConnectivity<V,E>
-
getQuickComponentNumber
protected int getQuickComponentNumber(V vertex)
- Specified by:
getQuickComponentNumber
in classAbstractGraphConnectivity<V,E>
-
getConnectedComponent
public Set<V> getConnectedComponent(V vertex)
Description copied from interface:GraphConnectivity
Return the connected component set of given vertex- Specified by:
getConnectedComponent
in interfaceGraphConnectivity<V,E>
- Overrides:
getConnectedComponent
in classAbstractGraphConnectivity<V,E>
-
getNonConnectedVertices
public Set<V> getNonConnectedVertices(V vertex)
- Overrides:
getNonConnectedVertices
in classAbstractGraphConnectivity<V,E>
-
-