Class ConflictGraph
java.lang.Object
pl.poznan.put.structure.pseudoknots.ConflictGraph
- Direct Known Subclasses:
ImmutableConflictGraph
A graph of conflicts between regions. A conflict is when one region starts/end in the middle of
another region.d
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal List<ConflictClique>
Searches for connected components (named conflict cliques, although they are not real cliques).conflictsWith
(Region region) Returns all regions that conflict with a given one.final boolean
final boolean
hasConflicts
(Region region) Checks if a given region has any conflicts.static boolean
isConflicting
(Region first, Region second) Checks if given regions are conflicting.regions()
Returns all regions that are in conflict with at least one other region.final void
removeRegion
(Region region) Removes region and all associated conflicts with it from the graph.final ConflictGraph
Creates a simplified copy of this instance.
-
Constructor Details
-
ConflictGraph
public ConflictGraph()
-
-
Method Details
-
isConflicting
Checks if given regions are conflicting. A conflict is when one region starts/ends in the middle of another region.- Parameters:
first
- The first region.second
- The second region.- Returns:
- True if regions are conflicting.
-
regions
-
removeRegion
Removes region and all associated conflicts with it from the graph.- Parameters:
region
- The region to remove.
-
conflictsWith
Returns all regions that conflict with a given one.- Parameters:
region
- The region to search conflict for.- Returns:
- A collection of regions in conflict with the given one.
-
regionsWithConflicts
Returns all regions that are in conflict with at least one other region.- Returns:
- A set of regions which are in at least one conflict.
-
hasConflicts
public final boolean hasConflicts()- Returns:
- True if at least one region has at least one conflict.
-
hasConflicts
Checks if a given region has any conflicts.- Parameters:
region
- The region to check.- Returns:
- True if the given region has at least one conflict.
-
conflictCliques
Searches for connected components (named conflict cliques, although they are not real cliques).- Returns:
- The list of conflict cliques.
-
simplified
Creates a simplified copy of this instance. The simplification merges smaller region which are fully embedded into the bigger ones, if both the small and big region have exactly the same conflicts.- Returns:
- A simplified instance of this conflict graph.
-
conflicts
-