$darkmode
DENOPTIM
denoptim.graph.DGraph Class Reference

Container for the list of vertices and the edges that connect them. More...

Inheritance diagram for denoptim.graph.DGraph:
[legend]
Collaboration diagram for denoptim.graph.DGraph:
[legend]

Classes

class  DENOPTIMGraphDeserializer
 
class  DENOPTIMGraphSerializer
 We expect unique IDs for vertices. More...
 
class  EdgeFinder
 Utility to make selection of edges to a vertex tunable by a parameter. More...
 
enum  StringFormat
 Identifier for the format of string representations of a graph. More...
 

Public Member Functions

 DGraph (List< Vertex > gVertices, List< Edge > gEdges)
 
 DGraph (List< Vertex > gVertices, List< Edge > gEdges, List< Ring > gRings)
 
 DGraph (List< Vertex > gVertices, List< Edge > gEdges, List< Ring > gRings, List< SymmetricVertexes > symSets)
 
 DGraph (List< Vertex > gVertices, List< Edge > gEdges, List< Ring > gRings, List< ClosableChain > closableChains, List< SymmetricVertexes > symVertices)
 
 DGraph ()
 
void setCandidateOwner (Candidate candidate)
 Sets the reference to the candidate item that is defined by this graph. More...
 
Candidate getCandidateOwner ()
 Returns the reference of the candidate item that is defined by this graph. More...
 
void setGraphId (int id)
 
int getGraphId ()
 
void setLocalMsg (String msg)
 
String getLocalMsg ()
 
boolean hasSymmetricAP ()
 
boolean hasSymmetryInvolvingVertex (Vertex v)
 
int getSymmetricSetCount ()
 Returns the number of symmetric sets of vertices. More...
 
Iterator< SymmetricVertexesgetSymSetsIterator ()
 Get an iterator for the sets of symmetrically related vertices. More...
 
List< VertexgetSymVerticesForVertex (Vertex v)
 
boolean detectSymVertexSets () throws DENOPTIMException
 Tries to determine the set of symmetric vertices in this graph based on finding compatible Vertexes that are either using symmetric AttachmentPoints (NB: all symmetric APs must be in use by vertexes that are compatible with each other) or that are downstream (i.e., according to edge direction) w.r.t Vertexes that are using symmetric AttachmentPoints.The compatibility of the vertexes is determined by these criteria: More...
 
void removeSymmetrySet (SymmetricVertexes ss)
 Removed the given symmetric set, if present. More...
 
SymmetricVertexes getSymSetForVertex (Vertex v)
 Returns the set of vertexes symmetric to the given one. More...
 
void setSymmetricVertexSets (List< SymmetricVertexes > symVertices)
 
void addSymmetricSetOfVertices (SymmetricVertexes symSet) throws DENOPTIMException
 Adds a symmetric set of vertices to this graph. More...
 
void setVertexList (ArrayList< Vertex > vertices)
 
void setEdgeList (ArrayList< Edge > edges)
 
void setRings (ArrayList< Ring > rings)
 
void setCandidateClosableChains (ArrayList< ClosableChain > closableChains)
 
List< ClosableChaingetClosableChains ()
 
List< VertexgetVertexList ()
 
Vertex getSourceVertex ()
 Identifies and return the vertex from which the spanning tree originates. More...
 
List< EdgegetEdgeList ()
 
List< RinggetRings ()
 
List< EdgegetEdgesWithSrc (Vertex v)
 Returns the list of edges that depart from the given vertex, i.e., edges where the srcAP is owned by the given vertex. More...
 
List< EdgegetEdgesWithTrg (Vertex v)
 Returns the list of edges that arrive from the given vertex, i.e., edges where the trgAP is owned by the given vertex. More...
 
ArrayList< RinggetRingsInvolvingVertex (Vertex v)
 Returns the list of rings that include the given vertex in their fundamental cycle. More...
 
ArrayList< RinggetRingsInvolvingVertex (Vertex[] vs)
 Returns the list of rings that include the given list of vertices in their fundamental cycle. More...
 
ArrayList< RinggetRingsInvolvingVertexID (int vid)
 
boolean hasRings ()
 Check for rings in this graph. More...
 
boolean hasOrEmbedsRings ()
 Check for rings in this graph and in any graph that is embedded at any level in any vertex of this graph. More...
 
boolean isVertexIDInRing (int vid)
 
boolean isVertexInRing (Vertex v)
 
ArrayList< VertexgetRCVertices ()
 Search for ring closing vertices: vertices that contain only a RingClosingAttractor More...
 
ArrayList< VertexgetFreeRCVertices ()
 Search for unused ring closing vertices: vertices that contain only a RingClosingAttractor and are not part of any DENOPTIMRing More...
 
ArrayList< VertexgetUsedRCVertices ()
 Search for used ring closing vertices: vertices that contain only a RingClosingAttractor and are part of a DENOPTIMRing. More...
 
void addEdge (Edge edge)
 Adds the edge to the list of edges belonging to this graph. More...
 
void addRing (Ring ring)
 
void addRing (Vertex vI, Vertex vJ) throws DENOPTIMException
 Adds a chord between the given vertices, thus adding a ring in this graph. More...
 
void addRing (Vertex vI, Vertex vJ, BondType bndTyp)
 Adds a chord between the given vertices, thus adding a ring in this graph. More...
 
void addVertex (Vertex vertex) throws DENOPTIMException
 Appends a vertex to this graph without creating any edge. More...
 
void removeVertex (Vertex vertex)
 Remove a vertex from this graph. More...
 
boolean removeVertexAndWeld (Vertex vertex, FragmentSpace fragSpace) throws DENOPTIMException
 Remove a given vertex belonging to this graph and re-connects the resulting graph branches as much as possible. More...
 
boolean removeSingleVertexAndWeld (Vertex vertex, FragmentSpace fragSpace) throws DENOPTIMException
 Remove a given vertex belonging to this graph and re-connects the resulting graph branches as much as possible. More...
 
void replaceUnusedRCVsWithCapps (FragmentSpace fragSpace) throws DENOPTIMException
 Removes unused ring-closing vertices. More...
 
boolean replaceSubGraph (List< Vertex > subGrpVrtxs, DGraph incomingGraph, LinkedHashMap< AttachmentPoint, AttachmentPoint > apMap, FragmentSpace fragSpace) throws DENOPTIMException
 Replaced the subgraph represented by a given collection of vertices that belong to this graph. More...
 
List< List< Vertex > > getSymmetricSubGraphs (List< Vertex > subGrpVrtxs) throws DENOPTIMException
 We assume that the subgraph is a continuously connected, directed graph. More...
 
boolean replaceSingleSubGraph (List< Vertex > subGrpVrtxs, DGraph newSubGraph, LinkedHashMap< AttachmentPoint, AttachmentPoint > apMap) throws DENOPTIMException
 Replaced the subgraph represented by a given collection of vertices that belong to this graph. More...
 
boolean replaceVertex (Vertex vertex, int bbId, BBType bbt, LinkedHashMap< Integer, Integer > apIdMap, FragmentSpace fragSpace) throws DENOPTIMException
 Replaced a given vertex belonging to this graph with a new vertex generated specifically for this purpose. More...
 
boolean replaceVertex (Vertex vertex, int bbId, BBType bbt, LinkedHashMap< Integer, Integer > apIdMap, boolean symmetry, FragmentSpace fragSpace) throws DENOPTIMException
 Replaced a given vertex belonging to this graph with a new vertex generated specifically for this purpose. More...
 
boolean insertVertex (Edge edge, int bbId, BBType bbt, LinkedHashMap< AttachmentPoint, Integer > apMap, FragmentSpace fragSpace) throws DENOPTIMException
 Inserts a given vertex in between two vertices connected by the given edge. More...
 
boolean insertSingleVertex (Edge edge, Vertex newLink, LinkedHashMap< AttachmentPoint, AttachmentPoint > apMap) throws DENOPTIMException
 Inserts a given vertex in between two vertices connected by the given edge. More...
 
Vertex getVertexAtPosition (int pos)
 Returns the vertex that is in the given position of the list of vertices belonging to this graph. More...
 
boolean containsOrEmbedsVertex (Vertex v)
 Check if the specified vertex is contained in this graph as a node or in any inner graphs that may be embedded in Template-kind vertex belonging to this graph. More...
 
boolean containsVertex (Vertex v)
 Check if this graph contains the specified vertex. More...
 
int indexOf (Vertex v)
 Returns the index of a vertex in the list of vertices of this graph. More...
 
Vertex getVertexWithId (long vid)
 Searches for a vertex with the given identifier. More...
 
int indexOfVertexWithID (long vid)
 Returns the position of the first vertex that has the given ID. More...
 
void removeEdge (Edge edge)
 Removes an edge and update the free valences of the attachment points that were originally involved in this edge. More...
 
void removeRing (Ring ring)
 
Edge getEdgeAtPosition (int pos)
 
int getEdgeCount ()
 
int getRingCount ()
 
int getVertexCount ()
 
String toString ()
 
int getBondingAPIndex (Vertex srcVert, int dapidx, Vertex dstVert)
 
ArrayList< VertexgetChildVertices (Vertex vertex)
 
void getChildrenTree (Vertex vertex, List< Vertex > children)
 Gets all the children of the current vertex recursively. More...
 
void getChildrenTree (Vertex vertex, List< Vertex > children, boolean markBranches)
 Gets all the children of the current vertex recursively. More...
 
void getChildrenTree (Vertex vertex, List< Vertex > children, AtomicInteger branchIdGenerator, List< Integer > prevBranchId)
 Gets all the children of the current vertex recursively. More...
 
void getChildrenTree (Vertex vertex, List< Vertex > children, int numLayers, boolean stopBeforeRCVs)
 Gets all the children of the current vertex recursively. More...
 
List< Integer > getBranchIdOfVertexAtPosition (int i)
 Returns the branch identifier. More...
 
List< Integer > getBranchIdOfVertex (Vertex v)
 Returns the branch identifier. More...
 
String getBranchIdOfVertexAsStr (Vertex v)
 Returns the branch identifier as a literal string. More...
 
boolean directedPathExists (Vertex src, Vertex trg)
 Uses branch identifiers to define is two vertices are in such a relation that allows the drawing of a directed path from one to the other. More...
 
void getChildTreeLimited (Vertex vertex, List< Vertex > children, boolean stopBeforeRCVs)
 Gets all the children of the current vertex recursively. More...
 
void getChildTreeLimited (Vertex vertex, List< Vertex > children, Set< Vertex > limits)
 Gets all the children of the current vertex recursively until it finds one of the vertices listed as limit. More...
 
void getChildTreeLimited (Vertex vertex, List< Vertex > children, List< Vertex > limitsInClone, boolean stopBeforeRCVs)
 Gets all the children of the current vertex recursively until it finds one of the vertices listed as limit. More...
 
Vertex getDeepestAmongThese (List< Vertex > list)
 Identify the oldest ancestor (i.e., most great grandparent) in the given collection. More...
 
void getParentTree (Vertex vertex, List< Vertex > parentTree)
 Traverse the graph until it identifies the source of the directed path reachable from the given vertex recursively. More...
 
Vertex getParent (Vertex v)
 
DGraph clone ()
 Returns almost "deep-copy" of this graph. More...
 
Edge getEdgeWithParent (long l)
 Looks for an edge that points to a vertex with the given vertex id. More...
 
ArrayList< Integer > getIndexOfEdgesWithChild (int vid)
 
ArrayList< EdgegetEdgesWithChild (int vid)
 
long getMaxVertexId ()
 
boolean containsVertexID (long l)
 Checks if a number is already used as VertexIDs within the graph. More...
 
void cleanup ()
 Wipes the data in this graph. More...
 
boolean isIsomorphicTo (DGraph other)
 Checks if this graph is "DENOPTIM-isomorphic" to the other one given. More...
 
boolean isIsostructuralTo (DGraph other)
 Checks if this graph is "DENOPTIM-isostructural" to the other one given. More...
 
boolean sameAs (DGraph other, StringBuilder reason)
 Compare this and another graph ignoring the vertex IDs. More...
 
boolean containsAtoms ()
 Returns true if this graph has any vertex that contains atoms. More...
 
int getHeavyAtomsCount ()
 Calculate the number of atoms from the graph representation. More...
 
ArrayList< AttachmentPointgetAttachmentPoints ()
 Returns the list of all attachment points contained in this graph. More...
 
ArrayList< AttachmentPointgetAvailableAPs ()
 Returns the list of available attachment points contained in this graph. More...
 
List< AttachmentPointgetAvailableAPsThroughout ()
 Returns the list of attachment points contained in this graph that are available throughout the template barrier, i.e., are free in this graph an in any embedding graph that containing this one. More...
 
AttachmentPoint getAPWithId (int id)
 Returns the attachment point with the given identifier, or null if no AP is found with the given identifier. More...
 
boolean graphNeedsCappingGroups (FragmentSpace fragSpace)
 Checks the graph for unused APs that need to be capped. More...
 
void removeCappingGroupsOn (Vertex vertex)
 Remove capping groups on the given vertex of this graph. More...
 
void removeCappingGroups (List< Vertex > lstVerts)
 Remove capping groups that belong to this graph and are in the given list. More...
 
void removeCappingGroupsFromChilds (List< Vertex > lstVerts)
 
void removeCappingGroups ()
 Remove all capping groups on this graph. More...
 
void addCappingGroups (FragmentSpace fragSpace) throws DENOPTIMException
 Add a capping groups on free unused attachment points. More...
 
void addCappingGroups (List< Vertex > vertexAddedToThis, FragmentSpace fragSpace) throws DENOPTIMException
 Add a capping group on the given vertices, if needed. More...
 
DGraph extractSubgraph (int index) throws DENOPTIMException
 Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex. More...
 
DGraph extractSubgraph (Vertex seed) throws DENOPTIMException
 Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex. More...
 
DGraph extractSubgraph (Vertex seed, int numLayers, boolean stopBeforeRCVs) throws DENOPTIMException
 Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex and visiting at most a given number of vertex layers, and optionally stopping the exploration of a branch before including any ring-closing vertex. More...
 
DGraph extractSubgraph (Vertex seed, List< Vertex > limits, boolean stopBeforeRCVs) throws DENOPTIMException
 Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex and stopping the exploration at the given end vertices (i.e., limits). More...
 
DGraph extractSubgraph (Vertex seed, boolean stopBeforeRCVs) throws DENOPTIMException
 Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex. More...
 
List< DGraphextractPattern (GraphPattern pattern) throws DENOPTIMException
 Extracts subgraphs that match the provided pattern. More...
 
Map< DGraph, ObjectPairextractPattern (GraphPattern pattern, boolean recordConnectivity) throws DENOPTIMException
 Extracts subgraphs that match the provided pattern. More...
 
DGraph extractSubgraph (Collection< Vertex > definedOn)
 Returns a clone of the subgraph defined by the a collection of vertices belonging to this graph. More...
 
DGraph extractSubgraph (Collection< Vertex > definedOn, Set< Edge > connectionToSubgraph, Set< Edge > connectionFromSubgraph)
 Returns a clone of the subgraph defined by the a collection of vertices belonging to this graph. More...
 
DGraph embedPatternsInTemplates (GraphPattern pattern, FragmentSpace fragSpace) throws DENOPTIMException
 Searches for the given pattern type and generated a new graph where each set of (clones of) vertexes that define one such patterns is embedded in a single template. More...
 
DGraph embedPatternsInTemplates (GraphPattern pattern, FragmentSpace fragSpace, ContractLevel contract) throws DENOPTIMException
 Searches for the given pattern type and generated a new graph where each set of (clones of) vertexes that define one such patterns is embedded in a single template. More...
 
boolean removeBranchStartingAt (Vertex v, boolean symmetry) throws DENOPTIMException
 Deletes the branch, i.e., the specified vertex and its children. More...
 
boolean removeBranchStartingAt (Vertex v) throws DENOPTIMException
 Deletes the branch, i.e., the specified vertex and its children. More...
 
boolean removeOrphanBranchStartingAt (Vertex v) throws DENOPTIMException
 Deletes the branch, i.e., the specified vertex and its children. More...
 
boolean removeChainUpToBranching (Vertex v, FragmentSpace fragSpace) throws DENOPTIMException
 Mutates the graph by removing the chain where a given vertex is located up to the first branching (i.e., to non-capping group) on either side. More...
 
void changeSignOfVertexID ()
 Change all vertex IDs to the corresponding negative value. More...
 
void renumberGraphVertices ()
 Reassign vertex IDs to all vertices of this graph. More...
 
Map< Long, Long > renumberVerticesGetMap ()
 Reassign vertex IDs to a graph. More...
 
int getLevel (Vertex v)
 Calculates the level of a vertex in this graph. More...
 
Object[] checkConsistency (RunTimeParameters settings) throws DENOPTIMException
 Peeks into this graph to derive a preliminary chemical representation with SMILES and InChIKey. More...
 
Object[] checkConsistency (RunTimeParameters settings, boolean permissive) throws DENOPTIMException
 Peeks into this graph to derive a preliminary chemical representation with SMILES and InChIKey. More...
 
ArrayList< DGraphmakeAllGraphsWithDifferentRingSets (RunTimeParameters settings) throws DENOPTIMException
 Evaluates the possibility of closing rings in this graph and generates all alternative graphs resulting by different combinations of rings. More...
 
boolean hasForbiddenEnd (FragmentSpaceParameters fsSettings)
 Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused. More...
 
void appendGraphOnGraph (List< Vertex > parentVertices, List< Integer > parentAPIdx, DGraph subGraph, Vertex childVertex, int childAPIdx, BondType bndType, boolean onAllSymmAPs) throws DENOPTIMException
 Append a graph (incoming=I) onto this (receiving=R). More...
 
void appendVertexOnAP (AttachmentPoint srcAP, AttachmentPoint trgAP) throws DENOPTIMException
 Append a vertex to this graph: adds the new vertex to the list of vertices belonging to the graph, and adds the resulting edge to the graph. More...
 
void appendGraphOnAP (AttachmentPoint apOnThisGraph, AttachmentPoint apOnIncomingGraph, BondType bndType) throws DENOPTIMException
 Appends a graph onto this graph. More...
 
void appendGraphOnAP (Vertex parentVertex, int parentAPIdx, DGraph subGraph, Vertex childVertex, int childAPIdx, BondType bndType, Map< Vertex, SymmetricVertexes > newSymSets) throws DENOPTIMException
 Append a subgraph (I) to this graph (R) specifying which vertex and attachment point to use for the connection. More...
 
void appendGraphOnGraph (Vertex parentVertex, int parentAPIdx, DGraph subGraph, Vertex childVertex, int childAPIdx, BondType bndType, Map< Vertex, SymmetricVertexes > newSymSets, boolean onAllSymmAPs) throws DENOPTIMException
 Append a graph (incoming=I) onto this graph (receiving=R). More...
 
List< Long > findVerticesIds (VertexQuery query, Logger logger)
 Search a graph for vertices that match the criteria defined in a query vertex. More...
 
ArrayList< VertexfindVertices (VertexQuery vrtxQuery, Logger logger)
 Filters a list of vertices according to a query. More...
 
ArrayList< VertexfindVertices (VertexQuery vrtxQuery, boolean purgeSym, Logger logger)
 Filters a list of vertices according to a query. More...
 
void removeSymmetryRedundance (List< Vertex > list)
 Remove all but one of the symmetry-related partners in a list of vertices. More...
 
void removeSymmetryRedundantIds (ArrayList< Long > list)
 Remove all but one of the symmetry-related partners in a given list of vertex IDs. More...
 
DGraph editGraph (ArrayList< GraphEdit > edits, boolean symmetry, FragmentSpace fragSpace, Logger logger) throws DENOPTIMException
 Edit this graph according to a given list of edit tasks. More...
 
List< VertexgetMutableSites ()
 A list of mutation sites from within this graph. More...
 
List< VertexgetMutableSites (List< MutationType > ignoredTypes)
 A list of mutation sites from within this graph. More...
 
String toJson ()
 Produces a string that represents this graph and that adheres to the JSON format. More...
 
boolean hasScaffoldTypeVertex ()
 Checks if this graph contains a scaffold vertex. More...
 
void setTemplateJacket (Template template)
 Sets the reference to a template that embeds this graph, i.e., this graph's "jacket" template. More...
 
Template getTemplateJacket ()
 
DGraph getOutermostGraphOwner ()
 
List< TemplategetEmbeddingPath ()
 Find the path that one has to traverse to reach this graph from any template-embedding structure. More...
 
void storeCurrentVertexIDs ()
 Copies the current vertexID of each vertex into a property of the vertex itself. More...
 
AttachmentPoint getAPOnLeftVertexID (long nbrVid, long vid)
 Finds the AP that is on the first given parameter and that is used to make a connection to the second vertex, no matter the direction of the edge. More...
 
boolean isReversible (FragmentSpace fragSpace)
 Checks is the every edge in the graph can be defined in the opposite direction according to the APClass compatibility rules. More...
 
List< AttachmentPointgetInterfaceAPs (List< Vertex > subGraphB)
 Searches for all AttachmentPoints that represent the interface between a subgraph, identified by the given list of vertices, and any other vertex, i.e., either belonging to the same graph but not to the same subgraph, or belonging to an outer embedding level. More...
 
List< AttachmentPointgetSubgraphAPs (List< Vertex > subGraphB)
 Searches for all AttachmentPoints that are owned by vertices in a subgraph but either available or used by vertices that do not belong to the subgraph. More...
 

Static Public Member Functions

static boolean areApsUsedBySymmetricUsers (AttachmentPoint apA, AttachmentPoint apB, Set< Vertex > alreadyAssignedVrtxs)
 Checks if the Vertexs that are attached to two given AttachmentPoints apA and apB satisfy these conditions: More...
 
static boolean compareGraphNodes (Vertex thisV, DGraph thisG, Vertex otherV, DGraph otherG) throws DENOPTIMException
 Compares graphs by spanning vertices starting from the given vertex and following the direction of edges. More...
 
static DGraph fromJson (String json)
 Reads a JSON string and returns an instance of this class. More...
 
static DGraph fromJson (Reader reader)
 Reads a JSON string and returns an instance of this class. More...
 
static void setScaffold (Vertex v)
 Update the graph so that the vertex argument is at the scaffold level i.e. More...
 
static DGraph getEmbeddedGraphInClone (DGraph graphY, DGraph graphB, List< Template > path)
 Searches for a graphs (X) embedded at any level in a graph (Y) by knowing. More...
 

Protected Member Functions

void reassignSymmetricLabels ()
 Marks the vertices of this graph with a string that is consistent for all vertices that belong to symmetric sets. More...
 
void convertSymmetricLabelsToSymmetricSets ()
 Looks for any symmetric labels, creates symmetric sets that collect the same information, and removes the original symmetric labels. More...
 
int getUniqueAPIndex ()
 
void ensureUniqueApIDs ()
 

Package Functions

Map< SymmetricAPs, List< Vertex > > findSymmetrySetsOfChildVertexes (Vertex vrtx, Set< Vertex > alreadyAssignedVrtxs)
 

Package Attributes

List< VertexgVertices
 The vertices belonging to this graph. More...
 
List< EdgegEdges
 The edges belonging to this graph. More...
 
List< RinggRings
 The rings defined in this graph. More...
 
List< ClosableChainclosableChains
 The potentially closable chains of vertices. More...
 
int graphId
 
String localMsg
 A free-format string used to record simple properties in the graph. More...
 
Candidate candidate
 Reference to the candidate entity owning this graph, or null. More...
 
Template templateJacket
 Reference to the Template embedding this graph. More...
 

Private Member Functions

boolean sameAsRings (StringBuilder reason, Map< Vertex, Vertex > vertexMap, Ring rT, Vertex vhT, Vertex vtT, Ring rO)
 

Static Private Member Functions

static boolean compareGraphNodes (Vertex seedOnA, DGraph gA, Vertex seedOnB, DGraph gB, Map< Vertex, Vertex > vertexMap, StringBuilder reason) throws DENOPTIMException
 Compares graphs by spanning vertices starting from the given vertex and following the direction of edges. More...
 
static void reorderVertexList (DGraph g)
 Sets the vertex at the lowest level as the scaffold, changes the
directions of edges so that the scaffold is the source, and changes the levels of the graph's other vertices to be consistent with the new scaffold. More...
 
static void fixEdgeDirections (DGraph graph)
 Flips edges in the graph so that the scaffold is the only source vertex. More...
 
static void fixEdgeDirections (Vertex v, Set< Long > visited)
 Recursive utility method for fixEdgeDirections(graph). More...
 

Private Attributes

List< SymmetricVertexessymVertices
 
DefaultUndirectedGraph< Vertex, UndirectedEdgejGraph = null
 JGraph representation used to detect DENOPTIM-isomorphism. More...
 
DefaultUndirectedGraph< Node, NodeConnectionjGraphKernel = null
 JGraph representation used to detect DENOPTIM-isostructural graphs. More...
 
AtomicInteger apCounter = new AtomicInteger(1)
 Generator of unique AP identifiers within this graph. More...
 

Detailed Description

Container for the list of vertices and the edges that connect them.

Author
Vishwesh Venkatraman
Marco Foscato

Definition at line 101 of file DGraph.java.

Constructor & Destructor Documentation

◆ DGraph() [1/5]

◆ DGraph() [2/5]

denoptim.graph.DGraph.DGraph ( List< Vertex gVertices,
List< Edge gEdges,
List< Ring gRings 
)

◆ DGraph() [3/5]

denoptim.graph.DGraph.DGraph ( List< Vertex gVertices,
List< Edge gEdges,
List< Ring gRings,
List< SymmetricVertexes symSets 
)

◆ DGraph() [4/5]

denoptim.graph.DGraph.DGraph ( List< Vertex gVertices,
List< Edge gEdges,
List< Ring gRings,
List< ClosableChain closableChains,
List< SymmetricVertexes symVertices 
)

◆ DGraph() [5/5]

denoptim.graph.DGraph.DGraph ( )

Definition at line 223 of file DGraph.java.

References denoptim.graph.DGraph.closableChains, denoptim.graph.DGraph.gEdges, denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.localMsg, and denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.embedPatternsInTemplates(), and denoptim.graph.DGraph.replaceVertex().

Here is the caller graph for this function:

Member Function Documentation

◆ addCappingGroups() [1/2]

void denoptim.graph.DGraph.addCappingGroups ( FragmentSpace  fragSpace) throws DENOPTIMException

Add a capping groups on free unused attachment points.

Addition of Capping groups does not update the symmetry table for a symmetric graph.

Definition at line 4169 of file DGraph.java.

References denoptim.graph.DGraph.addCappingGroups(), and denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.addCappingGroups(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.ga.EAUtils.buildGraph(), and denoptim.graph.DGraph.replaceSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCappingGroups() [2/2]

void denoptim.graph.DGraph.addCappingGroups ( List< Vertex vertexAddedToThis,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Add a capping group on the given vertices, if needed.

The need for such groups is manifest when an attachment point that is not used in this or any embedding lever (i.e., attachment point is AttachmentPoint#isAvailableThroughout()) has and APClass that demands to be capped. Addition of Capping groups does not update the symmetry table for a symmetric graph.

Parameters
vertexAddedToThislist of vertices to operate on. They must belong to this graph.
Exceptions
DENOPTIMExceptionif the addition of capping groups cannot be performed.

Definition at line 4192 of file DGraph.java.

References denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.BBType.CAP, denoptim.graph.Vertex.getAP(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), and denoptim.graph.Vertex.newVertexFromLibrary().

Here is the call graph for this function:

◆ addEdge()

void denoptim.graph.DGraph.addEdge ( Edge  edge)

Adds the edge to the list of edges belonging to this graph.

Parameters
edgeto be included in the list of edges

Definition at line 1021 of file DGraph.java.

References denoptim.graph.DGraph.gEdges, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.Template.getTestTemplate(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraphTest.makeDisorderedGraph(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphD(), denoptim.ga.PopulationTest.makeGraphE(), denoptim.ga.PopulationTest.makeGraphF(), denoptim.graph.DGraphTest.makeTestGraph1(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphA(), denoptim.graph.rings.PathSubGraphTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphA2(), denoptim.graph.rings.PathSubGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphD(), denoptim.graph.DGraphTest.makeTestGraphDSub1(), denoptim.graph.DGraphTest.makeTestGraphDSub2(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphE(), denoptim.graph.DGraphTest.makeTestGraphE(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphG(), denoptim.graph.DGraphTest.makeTestGraphH(), denoptim.graph.DGraphTest.makeTestGraphI(), denoptim.graph.DGraphTest.makeTestGraphJ(), denoptim.graph.DGraphTest.makeTestGraphK(), denoptim.graph.DGraphTest.makeTestGraphL(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.fragspace.APMapFinderTest.testAPMapFinder(), denoptim.graph.DGraphTest.testClone(), denoptim.graph.EdgeTest.testConnectionDeconnectionLoop(), denoptim.molecularmodeling.ThreeDimTreeBuilderTest.testConversionTo3dTree(), denoptim.graph.DGraphTest.testFromToJSON(), denoptim.graph.DGraphTest.testGetAvailableAPs_returnsListOfAvailableAPs(), denoptim.graph.AttachmentPointTest.testHasConnectedSrcAtom(), denoptim.graph.DGraphTest.testRemoveCapping(), denoptim.graph.DGraphTest.testRemoveUnusedRCVs(), denoptim.graph.DGraphTest.testRemoveVertex(), denoptim.graph.DGraphTest.testSameAs_DiffRings(), denoptim.graph.DGraphTest.testSameAs_DiffSymmSet(), denoptim.graph.DGraphTest.testSameAs_DiffVertex(), denoptim.graph.DGraphTest.testSameAs_DisorderRings(), denoptim.graph.DGraphTest.testSameAs_Equal(), denoptim.graph.DGraphTest.testSameAs_SameRings(), denoptim.graph.DGraphTest.testSameAs_SameSymmSet(), denoptim.io.DenoptimIOTest.testSerializeDeserializeDENOPTIMGraphs(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

◆ addRing() [1/3]

void denoptim.graph.DGraph.addRing ( Ring  ring)

Definition at line 1030 of file DGraph.java.

References denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.gui.GUIGraphHandler.addChordOnGraph(), denoptim.ga.GraphOperations.addRing(), denoptim.graph.DGraph.addRing(), denoptim.ga.GraphOperationsTest.addRings(), denoptim.graph.DGraph.appendGraphOnAP(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.fragspace.FragmentSpaceTest.getTestCase(), denoptim.ga.GraphOperationsTest.getThreeCycle(), denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), denoptim.graph.DGraphTest.makeIsostructuralGraphs(), denoptim.graph.DGraphTest.makeTestGraphD(), denoptim.graph.DGraphTest.makeTestGraphDSub1(), denoptim.graph.DGraphTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphG(), denoptim.graph.DGraphTest.makeTestGraphH(), denoptim.graph.DGraphTest.makeTestGraphI(), denoptim.graph.DGraphTest.makeTestGraphL(), denoptim.ga.EAUtilsTest.prepare(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraphTest.testClone(), denoptim.graph.TemplateTest.testClone(), denoptim.molecularmodeling.ThreeDimTreeBuilderTest.testConversionTo3dTree(), denoptim.graph.DGraphTest.testFromToJSON(), denoptim.graph.DGraphTest.testRemoveUnusedRCVs(), denoptim.graph.DGraphTest.testRemoveVertex(), denoptim.graph.DGraphTest.testSameAs_DiffRings(), denoptim.graph.DGraphTest.testSameAs_DisorderRings(), denoptim.graph.DGraphTest.testSameAs_SameRings(), denoptim.io.DenoptimIOTest.testSerializeDeserializeDENOPTIMGraphs(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

Here is the caller graph for this function:

◆ addRing() [2/3]

void denoptim.graph.DGraph.addRing ( Vertex  vI,
Vertex  vJ 
) throws DENOPTIMException

Adds a chord between the given vertices, thus adding a ring in this graph.

Parameters
vIone of the ring-closing vertices.
vJthe other of the ring-closing vertices.
Exceptions
DENOPTIMExceptionif the two vertices do not have consistent bond types to their parents and, therefore, we cannot infer the bond type of the chord.

Definition at line 1047 of file DGraph.java.

References denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Here is the call graph for this function:

◆ addRing() [3/3]

void denoptim.graph.DGraph.addRing ( Vertex  vI,
Vertex  vJ,
BondType  bndTyp 
)

Adds a chord between the given vertices, thus adding a ring in this graph.

Parameters
vIone of the ring-closing vertices.
vJthe other of the ring-closing vertices.
bndTypthe bond type the chord corresponds to.

Definition at line 1075 of file DGraph.java.

References denoptim.graph.DGraph.addRing(), denoptim.graph.rings.PathSubGraph.getVertecesPath(), denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, and denoptim.graph.Ring.setBondType().

Here is the call graph for this function:

◆ addSymmetricSetOfVertices()

void denoptim.graph.DGraph.addSymmetricSetOfVertices ( SymmetricVertexes  symSet) throws DENOPTIMException

Adds a symmetric set of vertices to this graph.

Parameters
symSetthe set to add
Exceptions
DENOPTIMExceptionis the symmetric set being added contains an id that is already contained in another set already present.

Definition at line 661 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.detectSymVertexSets(), denoptim.ga.GraphOperations.extendGraph(), denoptim.gui.GUIGraphHandler.initialize(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.DGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphC(), denoptim.graph.DGraphTest.makeTestGraphD(), denoptim.graph.DGraphTest.makeTestGraphDSub2(), denoptim.graph.DGraphTest.makeTestGraphE(), denoptim.graph.DGraphTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphG(), denoptim.graph.DGraphTest.makeTestGraphK(), denoptim.graph.DGraphTest.makeTestGraphL(), denoptim.graph.DGraphTest.testClone(), denoptim.ga.GraphOperationsTest.testExtendGraph(), denoptim.graph.DGraphTest.testFromToJSON(), denoptim.graph.DGraphTest.testRemoveVertex(), denoptim.graph.DGraphTest.testSameAs_DiffSymmSet(), denoptim.graph.DGraphTest.testSameAs_SameSymmSet(), and denoptim.io.DenoptimIOTest.testSerializeDeserializeDENOPTIMGraphs().

Here is the caller graph for this function:

◆ addVertex()

void denoptim.graph.DGraph.addVertex ( Vertex  vertex) throws DENOPTIMException

Appends a vertex to this graph without creating any edge.

This is a good way to add the first vertex, but can be used also if you intend to add edges manually.

Parameters
vertexthe vertex that will be added (no cloning).
Exceptions
DENOPTIMExceptionin the vertex has an ID that is already present in the current list of vertices of this graph, if any.

Definition at line 1097 of file DGraph.java.

References denoptim.graph.DGraph.containsVertexID(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.graph.DGraph.appendVertexOnAP(), denoptim.ga.EAUtils.buildGraph(), denoptim.ga.GraphOperationsTest.buildGraph(), denoptim.gui.GUIGraphHandler.createEmptyVertexAndPlaceItInGraph(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.TemplateTest.getNestedTemplate(), denoptim.ga.GraphOperationsTest.getPairOfTestGraphs(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.graph.TemplateTest.getTemplateDeepTest(), denoptim.graph.TemplateTest.getTestAmideTemplate(), denoptim.fragspace.FragmentSpaceTest.getTestCase(), denoptim.graph.Template.getTestTemplate(), denoptim.ga.GraphOperationsTest.getThreeCycle(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.gui.VertexAsGraphViewPanel.loadVertexStructure(), denoptim.graph.DGraphTest.makeDeeplyEmbeddedGraph(), denoptim.graph.DGraphTest.makeDisorderedGraph(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphD(), denoptim.ga.PopulationTest.makeGraphE(), denoptim.ga.PopulationTest.makeGraphF(), denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), denoptim.graph.DGraphTest.makeIsostructuralGraphs(), denoptim.graph.DGraphTest.makeTestGraph0(), denoptim.graph.DGraphTest.makeTestGraph1(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphA(), denoptim.graph.rings.PathSubGraphTest.makeTestGraphA(), denoptim.graph.rings.RingSizeManagerTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphA2(), denoptim.graph.rings.PathSubGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphC(), denoptim.graph.DGraphTest.makeTestGraphD(), denoptim.graph.DGraphTest.makeTestGraphDSub1(), denoptim.graph.DGraphTest.makeTestGraphDSub2(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphE(), denoptim.graph.DGraphTest.makeTestGraphE(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphG(), denoptim.graph.DGraphTest.makeTestGraphH(), denoptim.graph.DGraphTest.makeTestGraphI(), denoptim.graph.DGraphTest.makeTestGraphJ(), denoptim.graph.DGraphTest.makeTestGraphK(), denoptim.graph.DGraphTest.makeTestGraphL(), denoptim.graph.DGraphTest.makeTestGraphM(), denoptim.graph.DGraphTest.makeTestGraphN(), denoptim.ga.EAUtilsTest.prepare(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.gui.GUIGraphHandler.startGraphFromFragSpaceOrCreationOfEmptyVertex(), denoptim.combinatorial.CombinatorialExplorerByLayer.startNewGraphFromScaffold(), denoptim.ga.GraphOperationsTest.testAddRing(), denoptim.fragspace.APMapFinderTest.testAPMapFinder(), denoptim.graph.TemplateTest.testAtLeastSameNumberOfAPs(), denoptim.graph.AttachmentPointTest.testAvailableThrougout(), denoptim.ga.EAUtilsTest.testAvoidRedundantXOver(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.EdgeTest.testConnectionDeconnectionLoop(), denoptim.molecularmodeling.ThreeDimTreeBuilderTest.testConversionTo3dTree(), denoptim.graph.rings.PathClosabilityToolsTest.testEvaluateConstitutionalClosability(), denoptim.graph.rings.RandomCombOfRingIteratorTest.testEvaluateConstitutionalClosability(), denoptim.graph.rings.RingSizeManagerTest.testEvaluateRCVPair(), denoptim.ga.GraphOperationsTest.testExtendGraph(), denoptim.fragspace.APMapFinderTest.testFindMappingCompatibileAPs(), denoptim.graph.TemplateTest.testGetAttachmentPoints_returnsAPsWithTemplateAsOwner(), denoptim.graph.TemplateTest.testGetAttachmentPoints_returnsCorrectNumberOfAPs(), denoptim.graph.DGraphTest.testGetAvailableAPs_returnsListOfAvailableAPs(), denoptim.graph.AttachmentPointTest.testGetEdbeUserThrougout(), denoptim.graph.AttachmentPointTest.testGetEmbeddedAP(), denoptim.graph.AttachmentPointTest.testGetLinkedAP(), denoptim.graph.DGraphTest.testGetMutationSites(), denoptim.graph.DGraphTest.testGraphIsomorphism(), denoptim.graph.AttachmentPointTest.testHasConnectedSrcAtom(), denoptim.graph.AttachmentPointTest.testHasSameSrcAtom(), denoptim.graph.DGraphTest.testIsIsostructuralTo(), denoptim.graph.AttachmentPointTest.testIsSrcInUser(), denoptim.graph.DGraphTest.testRemoveCapping(), denoptim.graph.DGraphTest.testRemoveUnusedRCVs(), denoptim.ga.EAUtilsTest.testSelectNonScaffoldNonCapVertex(), denoptim.graph.TemplateTest.testSetInnerGraph_throws_on_graph_incompatible_w_requiredAPs(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

Here is the call graph for this function:

◆ appendGraphOnAP() [1/2]

void denoptim.graph.DGraph.appendGraphOnAP ( AttachmentPoint  apOnThisGraph,
AttachmentPoint  apOnIncomingGraph,
BondType  bndType 
) throws DENOPTIMException

Appends a graph onto this graph.

The operation is not projected by symmetry, and the incoming graph is not cloned/copied.

Parameters
apOnThisGraphwhere to append to on this growing graph.
apOnIncomingGraphwhere to connect this graph into the incoming one.
bndTypethe bond type of the new edge created.
Exceptions
DENOPTIMException

Definition at line 5826 of file DGraph.java.

References denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.cleanup(), denoptim.graph.DGraph.getEdgeList(), denoptim.graph.DGraph.getRings(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.DGraph.renumberGraphVertices().

Referenced by denoptim.graph.DGraph.appendGraphOnGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendGraphOnAP() [2/2]

void denoptim.graph.DGraph.appendGraphOnAP ( Vertex  parentVertex,
int  parentAPIdx,
DGraph  subGraph,
Vertex  childVertex,
int  childAPIdx,
BondType  bndType,
Map< Vertex, SymmetricVertexes newSymSets 
) throws DENOPTIMException

Append a subgraph (I) to this graph (R) specifying which vertex and attachment point to use for the connection.

Does not project on symmetrically related vertices or attachment points. No change in symmetric sets, apart from importing those sets that are already defined in the subgraph.

Parameters
parentVertexthe vertex of R on which a copy of I is to be attached.
parentAPIdxthe attachment point on R's vertex to be used to attach I
subGraphthe incoming graph I, or child graph.
childVertexthe vertex of I that is to be connected to R
childAPIdxthe index of the attachment point on the vertex of I that is to be connected to R
bndTypethe bond type between R and I
newSymSetsof symmetric sets. This parameter is only used to keep track of the symmetric copies of I. Simply provide an empty data structure.

Definition at line 5880 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addSymmetricSetOfVertices(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.clone(), denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.getEdgeList(), denoptim.graph.DGraph.getRings(), denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.DGraph.getVertexWithId(), and denoptim.graph.DGraph.renumberGraphVertices().

Here is the call graph for this function:

◆ appendGraphOnGraph() [1/2]

void denoptim.graph.DGraph.appendGraphOnGraph ( List< Vertex parentVertices,
List< Integer >  parentAPIdx,
DGraph  subGraph,
Vertex  childVertex,
int  childAPIdx,
BondType  bndType,
boolean  onAllSymmAPs 
) throws DENOPTIMException

Append a graph (incoming=I) onto this (receiving=R).

Can append one or more copies of the same graph. The corresponding vertex and attachment point ID for each connection are given in separated arrays.

Parameters
parentVerticesthe list of source vertices of R on which a copy of I is to be attached.
parentAPIdxthe list of attachment points on R's vertices to be used to attach I
subGraphthe incoming graph I, or child
childVertexthe vertex of I that is to be connected to R
childAPIdxthe index of the attachment point on the vertex of I that is to be connected to R
bndTypethe bond type between R and I
onAllSymmAPsset to true to require the same graph I to be attached on all available and symmetric APs on the same vertex of the AP indicated in the list.

Definition at line 5743 of file DGraph.java.

References denoptim.graph.DGraph.appendGraphOnGraph().

Referenced by denoptim.graph.DGraph.appendGraphOnGraph(), and denoptim.graph.DGraph.editGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendGraphOnGraph() [2/2]

void denoptim.graph.DGraph.appendGraphOnGraph ( Vertex  parentVertex,
int  parentAPIdx,
DGraph  subGraph,
Vertex  childVertex,
int  childAPIdx,
BondType  bndType,
Map< Vertex, SymmetricVertexes newSymSets,
boolean  onAllSymmAPs 
) throws DENOPTIMException

Append a graph (incoming=I) onto this graph (receiving=R).

Parameters
parentVertexthe vertex of R on which the a copy of I is to be attached.
parentAPIdxthe attachment point on R's vertex to be used to attach I
subGraphthe incoming graph I, or child
childVertexthe vertex of I that is to be connected to R
childAPIdxthe index of the attachment point on the vertex of I that is to be connected to R
bndTypethe bond type between R and I
newSymSetsthis parameter is only used to keep track of the symmetric copies of I. Simply provide an empty data structure.
onAllSymmAPsset to true to require the same graph I to be attached on all available and symmetric APs on the same vertex of the AP indicated in the list.

Definition at line 6005 of file DGraph.java.

References denoptim.graph.DGraph.appendGraphOnAP().

Here is the call graph for this function:

◆ appendVertexOnAP()

void denoptim.graph.DGraph.appendVertexOnAP ( AttachmentPoint  srcAP,
AttachmentPoint  trgAP 
) throws DENOPTIMException

Append a vertex to this graph: adds the new vertex to the list of vertices belonging to the graph, and adds the resulting edge to the graph.

Does not clone the incoming vertex. Does not project on symmetrically related vertices or attachment points. No change in symmetric sets, apart from importing those sets that are already defined in the incoming vertex.

Parameters
srcAPthe attachment point on this graph (source AP).
trgAPthe attachment point on the incoming vertex (target AP).
Exceptions
DENOPTIMException

Definition at line 5776 of file DGraph.java.

References denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.graph.Edge.BondType.ANY, and denoptim.graph.Edge.BondType.UNDEFINED.

Referenced by denoptim.graph.DGraph.addCappingGroups(), denoptim.ga.GraphOperations.addRing(), denoptim.ga.GraphOperationsTest.buildGraph(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.gui.GUIGraphHandler.extendCurrentGraph(), denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.TemplateTest.getNestedTemplate(), denoptim.ga.GraphOperationsTest.getPairOfTestGraphs(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.graph.TemplateTest.getTemplateDeepTest(), denoptim.graph.TemplateTest.getTestAmideTemplate(), denoptim.fragspace.FragmentSpaceTest.getTestCase(), denoptim.ga.GraphOperationsTest.getThreeCycle(), denoptim.graph.DGraphTest.makeDeeplyEmbeddedGraph(), denoptim.graph.DGraphTest.makeIsostructuralGraphs(), denoptim.graph.rings.RingSizeManagerTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphC(), denoptim.graph.DGraphTest.makeTestGraphK(), denoptim.graph.DGraphTest.makeTestGraphM(), denoptim.graph.DGraphTest.makeTestGraphN(), denoptim.ga.EAUtilsTest.prepare(), denoptim.graph.DGraph.replaceUnusedRCVsWithCapps(), denoptim.ga.GraphOperationsTest.testAddRing(), denoptim.graph.AttachmentPointTest.testAvailableThrougout(), denoptim.ga.EAUtilsTest.testAvoidRedundantXOver(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.rings.PathClosabilityToolsTest.testEvaluateConstitutionalClosability(), denoptim.graph.rings.RandomCombOfRingIteratorTest.testEvaluateConstitutionalClosability(), denoptim.graph.rings.RingSizeManagerTest.testEvaluateRCVPair(), denoptim.ga.GraphOperationsTest.testExtendGraph(), denoptim.fragspace.APMapFinderTest.testFindMappingCompatibileAPs(), denoptim.graph.TemplateTest.testGetAttachmentPoints_returnsCorrectNumberOfAPs(), denoptim.graph.AttachmentPointTest.testGetEdbeUserThrougout(), denoptim.graph.AttachmentPointTest.testGetEmbeddedAP(), denoptim.graph.AttachmentPointTest.testGetLinkedAP(), denoptim.graph.DGraphTest.testGraphIsomorphism(), denoptim.graph.AttachmentPointTest.testIsSrcInUser(), and denoptim.ga.EAUtilsTest.testSelectNonScaffoldNonCapVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ areApsUsedBySymmetricUsers()

static boolean denoptim.graph.DGraph.areApsUsedBySymmetricUsers ( AttachmentPoint  apA,
AttachmentPoint  apB,
Set< Vertex alreadyAssignedVrtxs 
)
static

Checks if the Vertexs that are attached to two given AttachmentPoints apA and apB satisfy these conditions:

These conditions, when satisfied for a pair of used and symmetric AttachmentPoints apA and apB should suffice to assign the two user Vertexs to the same SymmetricVertexes set.

Parameters
apAone attachment point in the pair.
apBthe other attachment point in the pair.
alreadyAssignedVrtxsa set of vertexes that have been already assigned to SymmetricVertexes set.
Returns

Definition at line 565 of file DGraph.java.

References denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Fragment.isIsomorphicTo(), denoptim.graph.AttachmentPoint.sameAs(), and denoptim.graph.Vertex.sameAs().

Referenced by denoptim.graph.DGraph.detectSymVertexSets(), and denoptim.graph.DGraph.findSymmetrySetsOfChildVertexes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeSignOfVertexID()

void denoptim.graph.DGraph.changeSignOfVertexID ( )

Change all vertex IDs to the corresponding negative value.

For instance if the vertex ID is 12 this method changes it into -12.

Definition at line 5252 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeCount(), denoptim.graph.DGraph.getEdgeList(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getSrcVertex(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Edge.getTrgVertex(), denoptim.graph.DGraph.getVertexCount(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.Vertex.setVertexId().

Here is the call graph for this function:

◆ checkConsistency() [1/2]

Object[] denoptim.graph.DGraph.checkConsistency ( RunTimeParameters  settings) throws DENOPTIMException

Peeks into this graph to derive a preliminary chemical representation with SMILES and InChIKey.

The chemical entity is evaluated also against the criteria defined by the given settings WARNING Although Cartesian coordinates are assigned to each atom and pseudo-atom in the molecular representation, such coordinates do NOT represent a valid 3D model. As a consequence stereochemical descriptors in the INCHI representation are not consistent with the actual arrangement of fragments.

Parameters
settingsthe collection of settings defining the criteria with which we evaluate the graph.
Returns
an object array containing the InChI key, the SMILES string and the 2D representation of the molecule. null is returned if any check or conversion fails.
Exceptions
DENOPTIMException

Definition at line 5353 of file DGraph.java.

References denoptim.graph.DGraph.checkConsistency().

Referenced by denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.graph.DGraph.checkConsistency(), and denoptim.ga.EAUtils.readCandidateFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkConsistency() [2/2]

Object[] denoptim.graph.DGraph.checkConsistency ( RunTimeParameters  settings,
boolean  permissive 
) throws DENOPTIMException

Peeks into this graph to derive a preliminary chemical representation with SMILES and InChIKey.

The chemical entity is evaluated also against the criteria defined by the given settings WARNING Although Cartesian coordinates are assigned to each atom and pseudo-atom in the molecular representation, such coordinates do NOT represent a valid 3D model. As a consequence stereochemical descriptors in the INCHI representation are not consistent with the actual arrangement of fragments.

Parameters
settingsthe collection of settings defining the criteria with which we evaluate the graph.
permissiveuse true to ignore some of the most strict filtering criteria. This is typically done only when reading graphs from the user, thus assuming the user does intend to by-pass some filters when inspecting a graph that might not be possible to generate from the given settings,
Returns
an object array containing the InChI key, the SMILES string and the 2D representation of the molecule. null is returned if any check or conversion fails.
Exceptions
DENOPTIMException

Definition at line 5384 of file DGraph.java.

References denoptim.graph.rings.RingClosureParameters.allowRingClosures(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.utils.MoleculeUtils.getHeavyAtomCount(), denoptim.utils.MoleculeUtils.getInChIKeyForMolecule(), denoptim.fragspace.FragmentSpaceParameters.getMaxHeavyAtom(), denoptim.fragspace.FragmentSpaceParameters.getMaxMW(), denoptim.graph.rings.RingClosureParameters.getMaxRcaPerType(), denoptim.fragspace.FragmentSpaceParameters.getMaxRotatableBond(), denoptim.graph.rings.RingClosureParameters.getMinRcaPerType(), denoptim.graph.rings.RingClosureParameters.getMinRingClosures(), denoptim.utils.MoleculeUtils.getMolecularWeight(), denoptim.utils.MoleculeUtils.getNumberOfRotatableBonds(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.DGraph.getRCVertices(), denoptim.utils.MoleculeUtils.getSMILESForMolecule(), denoptim.utils.MoleculeUtils.getSymbolOrLabel(), denoptim.graph.DGraph.hasForbiddenEnd(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.graph.rings.RingClosingAttractor.RCATYPEMAP, denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), denoptim.graph.DGraph.toString(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().

Here is the call graph for this function:

◆ cleanup()

◆ clone()

DGraph denoptim.graph.DGraph.clone ( )

Returns almost "deep-copy" of this graph.

Only the APCLass members of member of this class should remain references to the original APClasses. The vertex IDs are not changed, so you might want to renumber the graph.

Definition at line 3186 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.Ring.addVertex(), denoptim.graph.DGraph.clone(), denoptim.graph.Vertex.clone(), denoptim.graph.DGraph.closableChains, denoptim.graph.DGraph.DGraph(), denoptim.graph.DGraph.gEdges, denoptim.graph.AttachmentPoint.getBondType(), denoptim.graph.Vertex.getIndexOfAP(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.DGraph.getVertexWithId(), denoptim.graph.DGraph.graphId, denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.localMsg, denoptim.graph.Ring.setBondType(), denoptim.graph.DGraph.setCandidateClosableChains(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.DGraph.setRings(), denoptim.graph.DGraph.setSymmetricVertexSets(), and denoptim.graph.DGraph.symVertices.

Referenced by denoptim.ga.GraphOperations.addRing(), denoptim.graph.DGraph.appendGraphOnAP(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.ga.OffspringEvaluationTask.call(), denoptim.programs.fitnessevaluator.FitnessEvaluationTask.call(), denoptim.graph.Candidate.clone(), denoptim.graph.DGraph.clone(), denoptim.molecularmodeling.ChemicalObjectModel.deepcopy(), denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.DGraph.extractSubgraph(), denoptim.ga.GraphOperationsTest.getExpectedSubgraphs(), denoptim.fragspace.FragmentSpaceTest.getExpectedTemplate(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), denoptim.ga.GraphOperations.performMutation(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.combinatorial.CEBLUtils.storeAllGraphsOfLevel(), denoptim.ga.EAUtilsTest.testAvoidRedundantXOver(), denoptim.graph.DGraphTest.testClone(), denoptim.fragspace.FragmentSpaceTest.testFusedRingOnlyAddedOnce(), denoptim.graph.DGraphTest.testGetEmbeddedGraphInClone(), denoptim.graph.DGraphTest.testGraphIsomorphism(), denoptim.graph.DGraphTest.testIsIsostructuralTo(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareGraphNodes() [1/2]

static boolean denoptim.graph.DGraph.compareGraphNodes ( Vertex  seedOnA,
DGraph  gA,
Vertex  seedOnB,
DGraph  gB,
Map< Vertex, Vertex vertexMap,
StringBuilder  reason 
) throws DENOPTIMException
staticprivate

Compares graphs by spanning vertices starting from the given vertex and following the direction of edges.

Parameters
seedOnAinitial vertex on the first graph.
gAthe first graph.
seedOnBinitial vertex on the second graph.
gBthe second graph.
vertexMapvertex mapping.
reasona string recording the reason for returning false.
Returns
true if the graphs are same at this node.
Exceptions
DENOPTIMException

Definition at line 3849 of file DGraph.java.

References denoptim.graph.DGraph.compareGraphNodes(), and denoptim.graph.Edge.getTrgVertex().

Here is the call graph for this function:

◆ compareGraphNodes() [2/2]

static boolean denoptim.graph.DGraph.compareGraphNodes ( Vertex  thisV,
DGraph  thisG,
Vertex  otherV,
DGraph  otherG 
) throws DENOPTIMException
static

Compares graphs by spanning vertices starting from the given vertex and following the direction of edges.

Parameters
thisVstarting vertex of first graph
thisGfirst graph
otherVstarting vertex of second graph
otherGsecond graph
Returns
true if the graphs are same at this node
Exceptions
DENOPTIMException

Definition at line 3825 of file DGraph.java.

References denoptim.graph.DGraph.compareGraphNodes().

Referenced by denoptim.graph.DGraph.compareGraphNodes(), denoptim.graph.DGraph.sameAs(), and denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsAtoms()

boolean denoptim.graph.DGraph.containsAtoms ( )

Returns true if this graph has any vertex that contains atoms.

Returns
true if this graph has any vertex that contains atoms.

Definition at line 3935 of file DGraph.java.

References denoptim.graph.DGraph.getVertexList().

Referenced by denoptim.graph.Template.containsAtoms(), and denoptim.gui.GraphVertexMolViewerPanel.updateMolevularViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsOrEmbedsVertex()

boolean denoptim.graph.DGraph.containsOrEmbedsVertex ( Vertex  v)

Check if the specified vertex is contained in this graph as a node or in any inner graphs that may be embedded in Template-kind vertex belonging to this graph.

Parameters
vthe vertex.
Returns
true if the vertex belongs to this graph or is anyhow embedded in it.

Definition at line 2530 of file DGraph.java.

References denoptim.graph.DGraph.containsOrEmbedsVertex(), denoptim.graph.Template.getInnerGraph(), and denoptim.graph.DGraph.gVertices.

Referenced by denoptim.ga.EAUtils.buildGraph(), and denoptim.graph.DGraph.containsOrEmbedsVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsVertex()

boolean denoptim.graph.DGraph.containsVertex ( Vertex  v)

Check if this graph contains the specified vertex.

Does not consider inner graphs that may be embedded in Template-kind vertex belonging to this graph.

Parameters
vthe vertex.
Returns
true if the vertex belongs to this graph.

Definition at line 2557 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraphTest.testRemoveCapping(), and denoptim.graph.DGraphTest.testReplaceVertex().

Here is the caller graph for this function:

◆ containsVertexID()

boolean denoptim.graph.DGraph.containsVertexID ( long  l)

Checks if a number is already used as VertexIDs within the graph.

Returns
true if the number is already used.

Definition at line 3349 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.addVertex().

Here is the caller graph for this function:

◆ convertSymmetricLabelsToSymmetricSets()

void denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets ( )
protected

Looks for any symmetric labels, creates symmetric sets that collect the same information, and removes the original symmetric labels.

Definition at line 1600 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.DGraph.addSymmetricSetOfVertices(), denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.hasSymmetryInvolvingVertex(), and denoptim.constants.DENOPTIMConstants.VRTSYMMSETID.

Referenced by denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.graph.DGraphTest.testConvertSymmetricLabelsToSymmetricSets(), and denoptim.graph.DGraphTest.testReplaceSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectSymVertexSets()

boolean denoptim.graph.DGraph.detectSymVertexSets ( ) throws DENOPTIMException

Tries to determine the set of symmetric vertices in this graph based on finding compatible Vertexes that are either using symmetric AttachmentPoints (NB: all symmetric APs must be in use by vertexes that are compatible with each other) or that are downstream (i.e., according to edge direction) w.r.t Vertexes that are using symmetric AttachmentPoints.The compatibility of the vertexes is determined by these criteria:

  • the AP used to link the parent vertex must have the same features as defined by the AttachmentPoint#sameAs(Vertex) method.
  • the vertex must have the same features as defined by the Vertex#sameAs(Vertex) method. Effectively, this means they are instances of the same building block in the fragment space, or are graph building blocks that are not part of the fragment space, in which case the last condition applies,
  • vertexes have same features and isomorphic internal structure as from the Fragment#isIsomorphicTo(Vertex) method.
Returns
true if some symmetric set of vertex has been found.
Exceptions
DENOPTIMException

Definition at line 372 of file DGraph.java.

References denoptim.graph.DGraph.addSymmetricSetOfVertices(), denoptim.graph.DGraph.areApsUsedBySymmetricUsers(), denoptim.graph.DGraph.findSymmetrySetsOfChildVertexes(), denoptim.graph.SymmetricAPs.getAllSameAs(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.DGraph.symVertices.

Referenced by denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), and denoptim.graph.DGraphTest.testDetectSymVertexSets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ directedPathExists()

boolean denoptim.graph.DGraph.directedPathExists ( Vertex  src,
Vertex  trg 
)

Uses branch identifiers to define is two vertices are in such a relation that allows the drawing of a directed path from one to the other.

You must run getChildrenTree(Vertex, List, AtomicInteger, List) on any parent of either graph to generate the bran branch labeling.

Parameters
srcthe "from" in the directed path relation.
trgthe "to" in the directed path relation.
Returns
true if the relation exists, false is if doesn't OR if the branch labeling has not been found.

Definition at line 3000 of file DGraph.java.

References denoptim.graph.DGraph.getBranchIdOfVertex().

Referenced by denoptim.graph.DGraphTest.testGetChildrenTreeWithBranchIdentifier().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ editGraph()

DGraph denoptim.graph.DGraph.editGraph ( ArrayList< GraphEdit edits,
boolean  symmetry,
FragmentSpace  fragSpace,
Logger  logger 
) throws DENOPTIMException

Edit this graph according to a given list of edit tasks.

This method assumes the vertex IDs are unique.

Parameters
editsthe list of edit tasks.
symmetryif true the same operation is performed on vertices related by symmetry.
fragSpacethe space of building blocks needed to perform the graph editing tasks. It may or may not be the space that generated the original version of the graph to edit.
loggerthe logger to use
Returns
the modified graph.

Definition at line 6453 of file DGraph.java.

References denoptim.graph.DGraph.appendGraphOnGraph(), denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.containsVertex(), denoptim.graph.DGraph.findVertices(), denoptim.graph.DGraph.getAPWithId(), denoptim.graph.DGraph.getAvailableAPs(), denoptim.graph.Edge.getBondType(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.AttachmentPoint.getIndexInOwner(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getParent(), denoptim.graph.Edge.getSrcAPID(), denoptim.utils.GraphEdit.getType(), denoptim.graph.DGraph.removeBranchStartingAt(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.DGraph.replaceSingleSubGraph(), and denoptim.graph.DGraph.replaceVertex().

Referenced by denoptim.programs.grapheditor.GraphEditor.runProgram().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ embedPatternsInTemplates() [1/2]

DGraph denoptim.graph.DGraph.embedPatternsInTemplates ( GraphPattern  pattern,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Searches for the given pattern type and generated a new graph where each set of (clones of) vertexes that define one such patterns is embedded in a single template.

Parameters
patterntype of pattern to embed in template.
Returns
a new graph where the vertexes defining each pattern are replaced by a template that embeds the subgraph of the pattern.
Exceptions
DENOPTIMException

Definition at line 4616 of file DGraph.java.

References denoptim.graph.DGraph.embedPatternsInTemplates(), and denoptim.graph.Template.ContractLevel.FREE.

Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.DGraphTest.testEmbedPatternsInTemplates(), and denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ embedPatternsInTemplates() [2/2]

DGraph denoptim.graph.DGraph.embedPatternsInTemplates ( GraphPattern  pattern,
FragmentSpace  fragSpace,
ContractLevel  contract 
) throws DENOPTIMException

Searches for the given pattern type and generated a new graph where each set of (clones of) vertexes that define one such patterns is embedded in a single template.

Parameters
patterntype of pattern to embed in template.
fragSpacethe fragment space that defines how we manipulate fragments.
contractthe level of constraint to set for any template that embeds one of the patterns.
Returns
a new graph where the vertexes defining each pattern are replaced by a template that embeds the subgraph of the pattern.
Exceptions
DENOPTIMException

Definition at line 4637 of file DGraph.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.DGraph(), denoptim.graph.DGraph.ensureUniqueApIDs(), denoptim.graph.DGraph.extractPattern(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.graph.DGraph.getAPWithId(), denoptim.graph.AttachmentPoint.getID(), denoptim.graph.Template.getOuterAPFromInnerAP(), denoptim.graph.Vertex.getProperty(), denoptim.graph.DGraph.getVertexWithId(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.hasScaffoldTypeVertex(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.Template.setContractLevel(), denoptim.graph.Template.setInnerGraph(), and denoptim.constants.DENOPTIMConstants.STOREDVID.

Here is the call graph for this function:

◆ ensureUniqueApIDs()

void denoptim.graph.DGraph.ensureUniqueApIDs ( )
protected

Definition at line 6669 of file DGraph.java.

References denoptim.graph.DGraph.apCounter, and denoptim.graph.DGraph.getAttachmentPoints().

Referenced by denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.DGraph.DENOPTIMGraphSerializer.serialize(), and denoptim.graph.Template.toJson().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractPattern() [1/2]

List< DGraph > denoptim.graph.DGraph.extractPattern ( GraphPattern  pattern) throws DENOPTIMException

Extracts subgraphs that match the provided pattern.

Parameters
patternto match against.
Returns
The subgraphs matching the provided pattern. These contain clones of the vertexes in this graph.
Exceptions
DENOPTIMException

Definition at line 4457 of file DGraph.java.

References denoptim.graph.DGraph.extractPattern().

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.DGraph.extractPattern(), denoptim.ga.GraphOperationsTest.testExtractPattern_fusedRings(), denoptim.ga.GraphOperationsTest.testExtractPattern_returnsEmptyListIfNoRings(), and denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractPattern() [2/2]

Map< DGraph, ObjectPair > denoptim.graph.DGraph.extractPattern ( GraphPattern  pattern,
boolean  recordConnectivity 
) throws DENOPTIMException

Extracts subgraphs that match the provided pattern.

This method offers the possibility to record the connections that cross the border of each subgraph.

Parameters
patternto match against.
recordConnectivityif true makes this method collect the edges of this graph that cross the subgraph borders. If false the resulting map will have only keys and null values.
Returns
The subgraphs matching the provided pattern. Each such subgraph contains clones of the vertexes in this graph. Each value of the returned map contains two lists defining which edges cross the subgraph border: first, the list of incoming edges (i.e., the source AttachmentPoint belongs to a vertex that does not belong the subgraph), second, the list of outgoing edges (i.e., the source AttachmentPoint belongs to a vertex that does belong the subgraph). Note that the owners of the AttachmentPoints are NOT the Vertex instances that are container in the map's key, but are their clones.
Exceptions
DENOPTIMException

Definition at line 4488 of file DGraph.java.

References denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.Ring.getVertices(), denoptim.graph.DGraph.reorderVertexList(), denoptim.graph.GraphPattern.RING, and denoptim.utils.GeneralUtils.unionOfIntersectingSets().

Here is the call graph for this function:

◆ extractSubgraph() [1/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Collection< Vertex definedOn)

Returns a clone of the subgraph defined by the a collection of vertices belonging to this graph.

Parameters
definedOnSet of vertices that defined the subgraph.
Returns
a clone of the subgraph of this graph.

Definition at line 4539 of file DGraph.java.

References denoptim.graph.DGraph.extractSubgraph().

Here is the call graph for this function:

◆ extractSubgraph() [2/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Collection< Vertex definedOn,
Set< Edge connectionToSubgraph,
Set< Edge connectionFromSubgraph 
)

Returns a clone of the subgraph defined by the a collection of vertices belonging to this graph.

It also collects which Edges exists between the subgraph and the rest of the graph.

Parameters
definedOnSet of vertices that defined the subgraph.
connectionToSubgraphcontainer for the collection of edges that arrive at the subgraph.
connectionFromSubgraphcontainer for the collection of edges that depart from the subgraph.
Returns
Subgraph of graph defined on set of vertices.

Definition at line 4558 of file DGraph.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.getEdgeList(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.DGraph.removeVertex().

Here is the call graph for this function:

◆ extractSubgraph() [3/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( int  index) throws DENOPTIMException

Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex.

Only the seed vertex and all child vertices (and further successors) are considered part of the subgraph, which includes also rings and symmetric sets. All rings that include vertices not belonging to the subgraph are lost.

Parameters
indexthe position of the seed vertex in the list of vertices of this graph.
Returns
a new graph that corresponds to the subgraph of this graph.

Definition at line 4258 of file DGraph.java.

References denoptim.graph.DGraph.extractSubgraph(), and denoptim.graph.DGraph.getVertexAtPosition().

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.graph.DGraph.extractPattern(), denoptim.graph.DGraph.extractSubgraph(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.ga.GraphOperations.performCrossover(), denoptim.ga.GraphOperations.processPermutationOfEndPoints(), denoptim.graph.DGraphTest.testExtractSubgraph(), and denoptim.graph.DGraphTest.testExtractSubgraphFromCollection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractSubgraph() [4/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Vertex  seed) throws DENOPTIMException

Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex.

Only the seed vertex and all child vertices (and further successors) are considered part of the subgraph, which includes also rings and symmetric sets. All rings that include vertices not belonging to the subgraph are lost.

Parameters
seedthe vertex from which the extraction has to start.
Returns
a new graph that corresponds to the subgraph of this graph.

Definition at line 4277 of file DGraph.java.

References denoptim.graph.DGraph.extractSubgraph().

Here is the call graph for this function:

◆ extractSubgraph() [5/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Vertex  seed,
boolean  stopBeforeRCVs 
) throws DENOPTIMException

Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex.

Optionally, you can ask to stop the exploration of a branch before including any ring-closing vertex. Only the seed vertex and all child vertices (and further successors) are considered part of the subgraph, which includes also rings and symmetric sets. All rings that include vertices not belonging to the subgraph are lost.

Parameters
seedthe vertex from which the extraction has to start.
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.
Returns
a new graph that corresponds to the subgraph of this graph.

Definition at line 4414 of file DGraph.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.getChildTreeLimited(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.indexOf(), and denoptim.graph.DGraph.removeVertex().

Here is the call graph for this function:

◆ extractSubgraph() [6/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Vertex  seed,
int  numLayers,
boolean  stopBeforeRCVs 
) throws DENOPTIMException

Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex and visiting at most a given number of vertex layers, and optionally stopping the exploration of a branch before including any ring-closing vertex.

Only the seed vertex and all child vertices (and further successors) are considered part of the subgraph, which includes also rings and symmetric sets. All rings that include vertices not belonging to the subgraph are lost.

Parameters
seedthe vertex from which the extraction has to start.
numLayersthe maximum number of vertex layers after the seen vertex that we want to consider before stopping. If this value is 2, we will explore three layers: the seed, and two more layers away from it.
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.
Returns
a new graph that corresponds to the subgraph of this graph.

Definition at line 4303 of file DGraph.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.getChildrenTree(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.indexOf(), and denoptim.graph.DGraph.removeVertex().

Here is the call graph for this function:

◆ extractSubgraph() [7/7]

DGraph denoptim.graph.DGraph.extractSubgraph ( Vertex  seed,
List< Vertex limits,
boolean  stopBeforeRCVs 
) throws DENOPTIMException

Creates a new graph that corresponds to the subgraph of this graph when exploring the spanning tree from a given seed vertex and stopping the exploration at the given end vertices (i.e., limits).

Optionally, you can ask to stop the exploration of a branch before including any ring-closing vertex. Only the seed vertex and all child vertices (and further successors) are considered part of the subgraph, which includes also rings and symmetric sets. All rings that include vertices not belonging to the subgraph are lost.

Parameters
seedthe vertex from which the extraction has to start.
limitsthe vertices playing the role of subgraph end-points that stop the exploration of the graph.
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.
Returns
a new graph that corresponds to the subgraph of this graph.

Definition at line 4354 of file DGraph.java.

References denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getChildTreeLimited(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.indexOf(), and denoptim.graph.DGraph.removeVertex().

Here is the call graph for this function:

◆ findSymmetrySetsOfChildVertexes()

Map< SymmetricAPs, List< Vertex > > denoptim.graph.DGraph.findSymmetrySetsOfChildVertexes ( Vertex  vrtx,
Set< Vertex alreadyAssignedVrtxs 
)
package

Definition at line 460 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.DGraph.areApsUsedBySymmetricUsers(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Vertex.getSymmetricAPSets().

Referenced by denoptim.graph.DGraph.detectSymVertexSets(), and denoptim.graph.DGraphTest.testFindSymmetrySetsOfChildVertexes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findVertices() [1/2]

ArrayList< Vertex > denoptim.graph.DGraph.findVertices ( VertexQuery  vrtxQuery,
boolean  purgeSym,
Logger  logger 
)

◆ findVertices() [2/2]

ArrayList< Vertex > denoptim.graph.DGraph.findVertices ( VertexQuery  vrtxQuery,
Logger  logger 
)

Filters a list of vertices according to a query.

vertex. Always removed symmetry-redundant matches.

Parameters
vrtxQuerythe query defining what is that we want to find.
loggermanager of log
Returns
the list of vertices that match the query.

Definition at line 6062 of file DGraph.java.

References denoptim.graph.DGraph.findVertices().

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.findVertices(), denoptim.graph.DGraph.findVerticesIds(), and denoptim.graph.DGraphTest.testFindVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findVerticesIds()

List< Long > denoptim.graph.DGraph.findVerticesIds ( VertexQuery  query,
Logger  logger 
)

Search a graph for vertices that match the criteria defined in a query vertex.

Parameters
querythe query
loggermanager of log
Returns
the list of matches

Definition at line 6042 of file DGraph.java.

References denoptim.graph.DGraph.findVertices().

Here is the call graph for this function:

◆ fixEdgeDirections() [1/2]

static void denoptim.graph.DGraph.fixEdgeDirections ( DGraph  graph)
staticprivate

Flips edges in the graph so that the scaffold is the only source vertex.

Parameters
graphto fix edges of.

Definition at line 4733 of file DGraph.java.

References denoptim.graph.DGraph.fixEdgeDirections(), and denoptim.graph.DGraph.getSourceVertex().

Referenced by denoptim.graph.DGraph.fixEdgeDirections(), and denoptim.graph.DGraph.reorderVertexList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fixEdgeDirections() [2/2]

static void denoptim.graph.DGraph.fixEdgeDirections ( Vertex  v,
Set< Long >  visited 
)
staticprivate

Recursive utility method for fixEdgeDirections(graph).

Parameters
vcurrent vertex

Definition at line 4745 of file DGraph.java.

References denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.Edge.flipEdge(), denoptim.graph.Vertex.getAP(), denoptim.graph.AttachmentPoint.getEdgeUser(), denoptim.graph.Vertex.getNumberOfAPs(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Edge.getSrcVertex(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Edge.getTrgVertex(), and denoptim.graph.Vertex.getVertexId().

Here is the call graph for this function:

◆ fromJson() [1/2]

static DGraph denoptim.graph.DGraph.fromJson ( Reader  reader)
static

Reads a JSON string and returns an instance of this class.

Parameters
jsonthe string to parse.
Returns
a new instance of this class.

Definition at line 6700 of file DGraph.java.

References denoptim.graph.DGraph.fromJson(), and denoptim.json.DENOPTIMgson.getReader().

Here is the call graph for this function:

◆ fromJson() [2/2]

static DGraph denoptim.graph.DGraph.fromJson ( String  json)
static

Reads a JSON string and returns an instance of this class.

Parameters
jsonthe string to parse.
Returns
a new instance of this class.

Definition at line 6685 of file DGraph.java.

References denoptim.graph.DGraph.fromJson(), and denoptim.json.DENOPTIMgson.getReader().

Referenced by denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.fromJson(), denoptim.graph.Template.fromJson(), denoptim.io.DenoptimIO.readDENOPTIMGraphsFromJSONFile(), denoptim.io.DenoptimIO.readGraphFromSDFileIAC(), and denoptim.graph.DGraphTest.testFromToJSON().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAPOnLeftVertexID()

AttachmentPoint denoptim.graph.DGraph.getAPOnLeftVertexID ( long  nbrVid,
long  vid 
)

Finds the AP that is on the first given parameter and that is used to make a connection to the second vertex, no matter the direction of the edge.

If the two vertices are connected by a chord, i.e., there is a pair of RCVs in between the two vertices, we still work out the AP on the vertex on the left, even if in the graph it is actually used to bind the RCV that defines the chord and that eventually connects the vertex on the left with that on the right.

Parameters
nbrVidvertex ID of one vertex.
vidvertex ID of another vertex.
Returns
the AttachmentPoint or null is the two vertex IDs are not connected in this graph.

Definition at line 7005 of file DGraph.java.

References denoptim.graph.DGraph.getChildVertices(), denoptim.graph.Vertex.getEdgeToParent(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), and denoptim.graph.DGraph.getVertexWithId().

Here is the call graph for this function:

◆ getAPWithId()

AttachmentPoint denoptim.graph.DGraph.getAPWithId ( int  id)

Returns the attachment point with the given identifier, or null if no AP is found with the given identifier.

Parameters
ididentifier of the attachment point to return
Returns
the attachment point with the given identifier, or null if no AP is found with the given identifier.

Definition at line 4035 of file DGraph.java.

References denoptim.graph.DGraph.getAttachmentPoints().

Referenced by denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.embedPatternsInTemplates(), and denoptim.graph.Template.updateInnerToOuter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttachmentPoints()

ArrayList< AttachmentPoint > denoptim.graph.DGraph.getAttachmentPoints ( )

Returns the list of all attachment points contained in this graph.

Returns
list of attachment points.

Definition at line 3970 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.ensureUniqueApIDs(), denoptim.graph.DGraph.getAPWithId(), denoptim.graph.DGraph.getAvailableAPs(), denoptim.graph.DGraph.getAvailableAPsThroughout(), and denoptim.ga.EAUtilsTest.testCrowdingProbability().

Here is the caller graph for this function:

◆ getAvailableAPs()

ArrayList< AttachmentPoint > denoptim.graph.DGraph.getAvailableAPs ( )

Returns the list of available attachment points contained in this graph.

Returns
list of attachment points.

Definition at line 3988 of file DGraph.java.

References denoptim.graph.DGraph.getAttachmentPoints().

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.utils.GraphConversionTool.getJGraphKernelFromGraph(), denoptim.graph.Template.isValidInnerGraph(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.Template.setInnerGraph(), denoptim.graph.DGraphTest.testGetAvailableAPs_returnsListOfAvailableAPs(), and denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAvailableAPsThroughout()

List< AttachmentPoint > denoptim.graph.DGraph.getAvailableAPsThroughout ( )

Returns the list of attachment points contained in this graph that are available throughout the template barrier, i.e., are free in this graph an in any embedding graph that containing this one.

Returns
list of attachment points.

Definition at line 4011 of file DGraph.java.

References denoptim.graph.DGraph.getAttachmentPoints().

Referenced by denoptim.ga.GraphOperations.addRing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBondingAPIndex()

int denoptim.graph.DGraph.getBondingAPIndex ( Vertex  srcVert,
int  dapidx,
Vertex  dstVert 
)
Parameters
srcVert
dapidxthe AP corresponding to the source fragment
dstVert
Returns
the AP index of the destination fragment
Deprecated:
this depends on vertedID rather than reference

Definition at line 2725 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeCount(), denoptim.graph.DGraph.getEdgeList(), denoptim.graph.Edge.getSrcAPID(), denoptim.graph.Edge.getSrcVertex(), denoptim.graph.Edge.getTrgAPID(), denoptim.graph.Edge.getTrgVertex(), and denoptim.graph.Vertex.getVertexId().

Here is the call graph for this function:

◆ getBranchIdOfVertex()

List< Integer > denoptim.graph.DGraph.getBranchIdOfVertex ( Vertex  v)

Returns the branch identifier.

Parameters
ithe position of the vertex to analyze.
Returns
the branch identifier or null if the vertex does not belong to this graph or if such property is not available. In the latter case, you should run getChildrenTree(Vertex, List, AtomicInteger, List) on any of the parent vertices.

Definition at line 2958 of file DGraph.java.

References denoptim.constants.DENOPTIMConstants.GRAPHBRANCHID, and denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.directedPathExists(), denoptim.graph.DGraph.getBranchIdOfVertexAsStr(), and denoptim.graph.DGraph.getBranchIdOfVertexAtPosition().

Here is the caller graph for this function:

◆ getBranchIdOfVertexAsStr()

String denoptim.graph.DGraph.getBranchIdOfVertexAsStr ( Vertex  v)

Returns the branch identifier as a literal string.

Parameters
ithe position of the vertex to analyze.
Returns
the branch identifier expressed as a string or null if the vertex does not belong to this graph or if such property is not available. In the latter case, you should run getChildrenTree(Vertex, List, AtomicInteger, List) on any of the parent vertices.

Definition at line 2978 of file DGraph.java.

References denoptim.graph.DGraph.getBranchIdOfVertex().

Referenced by denoptim.ga.GraphOperations.locateCompatibleXOverPoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBranchIdOfVertexAtPosition()

List< Integer > denoptim.graph.DGraph.getBranchIdOfVertexAtPosition ( int  i)

Returns the branch identifier.

Parameters
ithe position of the vertex to analyze.
Returns
the branch identifier or null if such property is not available. In such case, you should run getChildrenTree(Vertex, List, AtomicInteger, List) on any of the parent vertices.

Definition at line 2941 of file DGraph.java.

References denoptim.graph.DGraph.getBranchIdOfVertex(), and denoptim.graph.DGraph.getVertexAtPosition().

Referenced by denoptim.graph.DGraphTest.testGetChildrenTreeWithBranchIdentifier().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCandidateOwner()

Candidate denoptim.graph.DGraph.getCandidateOwner ( )

Returns the reference of the candidate item that is defined by this graph.

Returns
the reference to the owner or null.

Definition at line 251 of file DGraph.java.

References denoptim.graph.DGraph.candidate.

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), and denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the caller graph for this function:

◆ getChildrenTree() [1/4]

void denoptim.graph.DGraph.getChildrenTree ( Vertex  vertex,
List< Vertex children 
)

Gets all the children of the current vertex recursively.

This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children

Definition at line 2771 of file DGraph.java.

References denoptim.graph.DGraph.getChildrenTree(), and denoptim.graph.DGraph.getChildVertices().

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getChildrenTree(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.graph.DGraph.removeOrphanBranchStartingAt(), denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph(), denoptim.graph.DGraphTest.testGetChildrenTree(), and denoptim.graph.DGraphTest.testGetChildrenTreeWithBranchIdentifier().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getChildrenTree() [2/4]

void denoptim.graph.DGraph.getChildrenTree ( Vertex  vertex,
List< Vertex children,
AtomicInteger  branchIdGenerator,
List< Integer >  prevBranchId 
)

Gets all the children of the current vertex recursively.

All vertices belonging to the children tree are labelled by a property that identifies which branches they belong to (DENOPTIMConstants.GRAPHBRANCHID). This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
branchIdGeneratorthe generator of branch identifiers
prevBranchIdthe identifier of the branch holding the given vertex belongs.

Definition at line 2861 of file DGraph.java.

References denoptim.graph.DGraph.getChildrenTree(), denoptim.graph.DGraph.getChildVertices(), and denoptim.constants.DENOPTIMConstants.GRAPHBRANCHID.

Here is the call graph for this function:

◆ getChildrenTree() [3/4]

void denoptim.graph.DGraph.getChildrenTree ( Vertex  vertex,
List< Vertex children,
boolean  markBranches 
)

Gets all the children of the current vertex recursively.

All vertices belonging to the children tree can be labelled by a property that identifies which branches they belong to (DENOPTIMConstants.GRAPHBRANCHID). This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
markBranchestrue to set the DENOPTIMConstants.GRAPHBRANCHID property to vertices, including the initial one. vertex belongs.

Definition at line 2804 of file DGraph.java.

References denoptim.graph.DGraph.getChildrenTree(), denoptim.graph.DGraph.getChildVertices(), denoptim.constants.DENOPTIMConstants.GRAPHBRANCHID, and denoptim.graph.Vertex.setProperty().

Here is the call graph for this function:

◆ getChildrenTree() [4/4]

void denoptim.graph.DGraph.getChildrenTree ( Vertex  vertex,
List< Vertex children,
int  numLayers,
boolean  stopBeforeRCVs 
)

Gets all the children of the current vertex recursively.

This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
numLayersthe maximum number of vertex layers after the seen vertex that we want to consider before stopping. If this value is 2, we will explore three layers: the seed, and two more layers away from it.
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.

Definition at line 2906 of file DGraph.java.

References denoptim.graph.DGraph.getChildrenTree(), and denoptim.graph.DGraph.getChildVertices().

Here is the call graph for this function:

◆ getChildTreeLimited() [1/3]

void denoptim.graph.DGraph.getChildTreeLimited ( Vertex  vertex,
List< Vertex children,
boolean  stopBeforeRCVs 
)

Gets all the children of the current vertex recursively.

This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.

Definition at line 3028 of file DGraph.java.

References denoptim.graph.DGraph.getChildTreeLimited(), and denoptim.graph.DGraph.getChildVertices().

Referenced by denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getChildTreeLimited(), denoptim.graph.DGraph.getSymmetricSubGraphs(), denoptim.ga.GraphOperations.processPermutationOfEndPoints(), and denoptim.programs.genetweeker.GeneOpsRunner.runXOver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getChildTreeLimited() [2/3]

void denoptim.graph.DGraph.getChildTreeLimited ( Vertex  vertex,
List< Vertex children,
List< Vertex limitsInClone,
boolean  stopBeforeRCVs 
)

Gets all the children of the current vertex recursively until it finds one of the vertices listed as limit.

This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
limitsInClonethe list of vertices where exploration should stop.
stopBeforeRCVsset true to make the exploration of each branch stop before including ring closing vertices.

Definition at line 3092 of file DGraph.java.

References denoptim.graph.DGraph.getChildTreeLimited(), and denoptim.graph.DGraph.getChildVertices().

Here is the call graph for this function:

◆ getChildTreeLimited() [3/3]

void denoptim.graph.DGraph.getChildTreeLimited ( Vertex  vertex,
List< Vertex children,
Set< Vertex limits 
)

Gets all the children of the current vertex recursively until it finds one of the vertices listed as limit.

This method does not cross template boundaries, thus all children belong to the same graph.

Parameters
vertexthe vertex whose children are to be located
childrenlist containing the references to all the children
limitsthe list of vertices where exploration should stop.

Definition at line 3060 of file DGraph.java.

References denoptim.graph.DGraph.getChildTreeLimited(), and denoptim.graph.DGraph.getChildVertices().

Here is the call graph for this function:

◆ getChildVertices()

ArrayList< Vertex > denoptim.graph.DGraph.getChildVertices ( Vertex  vertex)
Parameters
vertexthe vertex for which the first level of child vertices need to be found.
Returns
list of child vertices.

Definition at line 2757 of file DGraph.java.

References denoptim.graph.Vertex.getChilddren().

Referenced by denoptim.graph.DGraph.getAPOnLeftVertexID(), denoptim.graph.DGraph.getChildrenTree(), denoptim.graph.DGraph.getChildTreeLimited(), denoptim.graph.DGraph.removeCappingGroupsFromChilds(), and denoptim.graph.DGraph.removeCappingGroupsOn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClosableChains()

List< ClosableChain > denoptim.graph.DGraph.getClosableChains ( )

Definition at line 712 of file DGraph.java.

References denoptim.graph.DGraph.closableChains.

◆ getDeepestAmongThese()

Vertex denoptim.graph.DGraph.getDeepestAmongThese ( List< Vertex list)

Identify the oldest ancestor (i.e., most great grandparent) in the given collection.

In case of two vertices being at the same level, this returns the first.

Returns
the vertex that has the shortest path to the source.

Definition at line 3123 of file DGraph.java.

References denoptim.graph.DGraph.getParentTree().

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEdgeAtPosition()

Edge denoptim.graph.DGraph.getEdgeAtPosition ( int  pos)

◆ getEdgeCount()

◆ getEdgeList()

◆ getEdgesWithChild()

ArrayList< Edge > denoptim.graph.DGraph.getEdgesWithChild ( int  vid)
Parameters
vid
Returns
the edge whose source vertex is same as vid

Definition at line 3314 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeAtPosition(), denoptim.graph.DGraph.getEdgeCount(), and denoptim.graph.Edge.getSrcVertex().

Here is the call graph for this function:

◆ getEdgesWithSrc()

List< Edge > denoptim.graph.DGraph.getEdgesWithSrc ( Vertex  v)

Returns the list of edges that depart from the given vertex, i.e., edges where the srcAP is owned by the given vertex.

Parameters
vthe given vertex.
Returns
the list of edges departing from the given vertex.

Definition at line 784 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeList().

Referenced by denoptim.graph.DGraphTest.testGetEdgesWithSrcOrTrg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEdgesWithTrg()

List< Edge > denoptim.graph.DGraph.getEdgesWithTrg ( Vertex  v)

Returns the list of edges that arrive from the given vertex, i.e., edges where the trgAP is owned by the given vertex.

Parameters
vthe given vertex.
Returns
the list of edges arriving to the given vertex.

Definition at line 805 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeList().

Referenced by denoptim.graph.DGraphTest.testGetEdgesWithSrcOrTrg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEdgeWithParent()

Edge denoptim.graph.DGraph.getEdgeWithParent ( long  l)

Looks for an edge that points to a vertex with the given vertex id.

Parameters
l
Returns
the edge whose target vertex has ID same as vid, or null

Definition at line 3273 of file DGraph.java.

References denoptim.graph.Vertex.getEdgeToParent(), and denoptim.graph.DGraph.getVertexWithId().

Referenced by denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEmbeddedGraphInClone()

static DGraph denoptim.graph.DGraph.getEmbeddedGraphInClone ( DGraph  graphY,
DGraph  graphB,
List< Template path 
)
static

Searches for a graphs (X) embedded at any level in a graph (Y) by knowing.

  • the embedding path (p) of another graph A that is embedded in graph B
  • and that graph Y is a unmodified clone of graph B, which implies that X is a clone of A.
    Parameters
    graphYwhere we want to find the analogous of graphA.
    graphBthe graph graphB where path points to graphA.
    paththe embedding path of graphA in graphB.
    Returns
    the graph embedded in graphY, i.e., graphX.

Definition at line 7085 of file DGraph.java.

References denoptim.graph.Template.getInnerGraph(), denoptim.graph.DGraph.getVertexAtPosition(), and denoptim.graph.DGraph.indexOf().

Referenced by denoptim.ga.XoverSite.projectToClonedGraphs(), and denoptim.graph.DGraphTest.testGetEmbeddedGraphInClone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEmbeddingPath()

List< Template > denoptim.graph.DGraph.getEmbeddingPath ( )

Find the path that one has to traverse to reach this graph from any template-embedding structure.

In practice, for a graph that is embedded a template jacket T1, which is part of another graph which is itself embedded in a template T2, which is again part of another graph, and so on it returns the references to the embedding templates stating from the outermost to the template that embeds this graph (Outermost reference come first in the resulting list). Instead a graph that is not embedded returns an empty path.

Returns
the path of references that allow to reach this graph from the outermost level of embedding.

Definition at line 6965 of file DGraph.java.

References denoptim.graph.DGraph.getEmbeddingPath(), denoptim.graph.Vertex.getGraphOwner(), and denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.graph.DGraph.getEmbeddingPath(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraphTest.testGetEmbeddedGraphInClone(), and denoptim.graph.DGraphTest.testGetEmbeddingPath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFreeRCVertices()

ArrayList< Vertex > denoptim.graph.DGraph.getFreeRCVertices ( )

Search for unused ring closing vertices: vertices that contain only a RingClosingAttractor and are not part of any DENOPTIMRing

Returns
the list of unused ring closing vertices

Definition at line 984 of file DGraph.java.

References denoptim.graph.DGraph.getRCVertices(), and denoptim.graph.DGraph.isVertexInRing().

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.graph.DGraph.getUsedRCVertices(), and denoptim.graph.rings.RingSizeManager.initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGraphId()

◆ getHeavyAtomsCount()

int denoptim.graph.DGraph.getHeavyAtomsCount ( )

Calculate the number of atoms from the graph representation.

Returns
number of heavy atoms in the molecule

Definition at line 3953 of file DGraph.java.

References denoptim.graph.DGraph.getVertexList().

Referenced by denoptim.graph.Template.getHeavyAtomsCount(), and denoptim.ga.EAUtils.getMolSizeProbability().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIndexOfEdgesWithChild()

ArrayList< Integer > denoptim.graph.DGraph.getIndexOfEdgesWithChild ( int  vid)
Parameters
vid
Returns
the indices of all edges whose source vertex is same as vid

Definition at line 3291 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeAtPosition(), denoptim.graph.DGraph.getEdgeCount(), and denoptim.graph.Edge.getSrcVertex().

Here is the call graph for this function:

◆ getInterfaceAPs()

List< AttachmentPoint > denoptim.graph.DGraph.getInterfaceAPs ( List< Vertex subGraphB)

Searches for all AttachmentPoints that represent the interface between a subgraph, identified by the given list of vertices, and any other vertex, i.e., either belonging to the same graph but not to the same subgraph, or belonging to an outer embedding level.

Parameters
subGraphBlist of vertices belonging to the subgraph.
Returns
the list of attachment points at the interface of the subgraph.

Definition at line 7113 of file DGraph.java.

Referenced by denoptim.fragspace.APMapFinder.APMapFinder(), denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.graph.DGraphTest.testGetInterfaceAPs(), and denoptim.ga.XoverSite.XoverSite().

Here is the caller graph for this function:

◆ getLevel()

int denoptim.graph.DGraph.getLevel ( Vertex  v)

Calculates the level of a vertex in this graph.

Parameters
vthe vertex for which we want the level.
Returns
the level, i.e., an integer that is -1 for the seed vertex of this graph and increases by one unit per each edge that has to be traversed to reach the vertex given as argument via a direct path.

Definition at line 5326 of file DGraph.java.

References denoptim.graph.DGraph.getParentTree().

Referenced by denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.DGraph.findVertices(), denoptim.graph.DGraph.removeChainUpToBranching(), and denoptim.graph.DGraphTest.testGetLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocalMsg()

String denoptim.graph.DGraph.getLocalMsg ( )

Definition at line 279 of file DGraph.java.

References denoptim.graph.DGraph.localMsg.

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.OffspringEvaluationTask.call(), denoptim.graph.Candidate.getFitnessProviderOutputRepresentation(), and denoptim.ga.GraphOperations.performMutation().

Here is the caller graph for this function:

◆ getMaxVertexId()

long denoptim.graph.DGraph.getMaxVertexId ( )
Returns
the maximum value of vertex Id found in this graph.

Definition at line 3334 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.gui.GUIGraphHandler.extendCurrentGraph(), denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.DGraph.removeVertexAndWeld(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), and denoptim.ga.EAUtils.setVertexCounterValue().

Here is the caller graph for this function:

◆ getMutableSites() [1/2]

List< Vertex > denoptim.graph.DGraph.getMutableSites ( )

A list of mutation sites from within this graph.

Returns
the list of vertices that allow any mutation type.

Definition at line 6622 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.ga.EAUtils.buildGraph(), and denoptim.graph.DGraphTest.testGetMutationSites().

Here is the caller graph for this function:

◆ getMutableSites() [2/2]

List< Vertex > denoptim.graph.DGraph.getMutableSites ( List< MutationType ignoredTypes)

A list of mutation sites from within this graph.

Parameters
ignoredTypesa collection of mutation types to ignore. vertices that allow only ignored types of mutation will not be considered mutation sites.
Returns
the list of vertices that allow any non-ignored mutation type.

Definition at line 6642 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

◆ getOutermostGraphOwner()

DGraph denoptim.graph.DGraph.getOutermostGraphOwner ( )
Returns
the outermost graph object that can be reached from this possibly embedded graph.

Definition at line 6943 of file DGraph.java.

References denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.DGraph.getOutermostGraphOwner(), and denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.graph.DGraph.getOutermostGraphOwner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParent()

Vertex denoptim.graph.DGraph.getParent ( Vertex  v)

Definition at line 3168 of file DGraph.java.

References denoptim.graph.Vertex.getEdgeToParent(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Edge.getSrcAP().

Referenced by denoptim.graph.DGraph.getParentTree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParentTree()

void denoptim.graph.DGraph.getParentTree ( Vertex  vertex,
List< Vertex parentTree 
)

Traverse the graph until it identifies the source of the directed path reachable from the given vertex recursively.

Parameters
vertexthe child vertex from which we start traversing the graph.
parentTreelist containing the references to all the parents recursively visited so far.

Definition at line 3149 of file DGraph.java.

References denoptim.graph.DGraph.getParent(), and denoptim.graph.DGraph.getParentTree().

Referenced by denoptim.graph.DGraph.getDeepestAmongThese(), denoptim.graph.DGraph.getLevel(), denoptim.graph.DGraph.getParentTree(), denoptim.graph.DGraph.getSourceVertex(), and denoptim.graph.rings.PathSubGraph.PathSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRCVertices()

ArrayList< Vertex > denoptim.graph.DGraph.getRCVertices ( )

Search for ring closing vertices: vertices that contain only a RingClosingAttractor

Returns
the list of ring closing vertices

Definition at line 962 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.graph.DGraph.getUsedRCVertices(), denoptim.graph.DGraph.replaceUnusedRCVsWithCapps(), denoptim.graph.rings.PathClosabilityToolsTest.testEvaluateConstitutionalClosability(), denoptim.graph.rings.RingSizeManagerTest.testEvaluateRCVPair(), and denoptim.graph.DGraphTest.testRemoveUnusedRCVs().

Here is the caller graph for this function:

◆ getRingCount()

◆ getRings()

◆ getRingsInvolvingVertex() [1/2]

ArrayList< Ring > denoptim.graph.DGraph.getRingsInvolvingVertex ( Vertex  v)

Returns the list of rings that include the given vertex in their fundamental cycle.

Parameters
vthe vertex to search for.
Returns
the list of rings of an empty list.

Definition at line 826 of file DGraph.java.

References denoptim.graph.DGraph.gRings.

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraph.replaceUnusedRCVsWithCapps(), and denoptim.graph.DGraph.sameAs().

Here is the caller graph for this function:

◆ getRingsInvolvingVertex() [2/2]

ArrayList< Ring > denoptim.graph.DGraph.getRingsInvolvingVertex ( Vertex[]  vs)

Returns the list of rings that include the given list of vertices in their fundamental cycle.

Parameters
vsthe collection of vertices to search for.
Returns
the list of rings of an empty list.

Definition at line 847 of file DGraph.java.

References denoptim.graph.DGraph.gRings.

◆ getRingsInvolvingVertexID()

ArrayList< Ring > denoptim.graph.DGraph.getRingsInvolvingVertexID ( int  vid)

Definition at line 871 of file DGraph.java.

References denoptim.graph.DGraph.gRings.

◆ getSourceVertex()

Vertex denoptim.graph.DGraph.getSourceVertex ( )

Identifies and return the vertex from which the spanning tree originates.

This is typically the first vertex in the list, but it is possible to programmatically build graphs that do not follow this convention. Therefore, here we test if the first vertex is a seed (i.e., it only has departing edges) and, if not, we search for the closest seed. WARNING: the graph is assumed to be an healthy spanning tree, in that it has only one seed that is reachable from any vertex by a inverse directed path. The result null for disconnected graphs or otherwise unhealthy spanning trees.

Returns
the seed/root of the spanning tree

Definition at line 740 of file DGraph.java.

References denoptim.graph.DGraph.getEdgeList(), denoptim.graph.DGraph.getParentTree(), denoptim.graph.DGraph.getVertexAtPosition(), and denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.reorderVertexList(), denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem(), denoptim.graph.DGraphTest.testGetSourceVertex(), and denoptim.graph.DGraphTest.testReplaceSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSubgraphAPs()

List< AttachmentPoint > denoptim.graph.DGraph.getSubgraphAPs ( List< Vertex subGraphB)

Searches for all AttachmentPoints that are owned by vertices in a subgraph but either available or used by vertices that do not belong to the subgraph.

Parameters
subGraphBlist of vertices belonging to the subgraph.
Returns
the list of attachment points originating from the subgraph.

Definition at line 7148 of file DGraph.java.

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.ga.GraphOperations.performCrossover(), and denoptim.graph.DGraphTest.testGetSubgraphAPs().

Here is the caller graph for this function:

◆ getSymmetricSetCount()

◆ getSymmetricSubGraphs()

List< List< Vertex > > denoptim.graph.DGraph.getSymmetricSubGraphs ( List< Vertex subGrpVrtxs) throws DENOPTIMException

We assume that the subgraph is a continuously connected, directed graph.

By contract, the source of the symmetric subgraph's spanning tree is always the first vertex in each returned list. Also, note that symmetry does not pertain capping groups, so capping groups are not expected to be among the vertices in the given list and will not be present in the resulting subgraphs.

Parameters
subGrpVrtxs
Returns
a collection of subgraphs, each represented by a list of vertices belonging to it.
Exceptions
DENOPTIMExceptionif capping groups are present in the list.

Definition at line 1816 of file DGraph.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.getChildTreeLimited(), and denoptim.graph.DGraph.getSymVerticesForVertex().

Referenced by denoptim.graph.DGraph.replaceSubGraph(), and denoptim.graph.DGraphTest.testGetSymmetricSubGraphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSymSetForVertex()

SymmetricVertexes denoptim.graph.DGraph.getSymSetForVertex ( Vertex  v)

Returns the set of vertexes symmetric to the given one.

Parameters
vthe vertex for which we seek the symmetric vertexes.
Returns
either the collector of vertexes symmetric to the given one, which also includes the given one, or an empty collector.

Definition at line 633 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.ga.GraphOperations.deleteChain(), denoptim.ga.GraphOperations.deleteFragment(), denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.DGraph.isIsomorphicTo(), denoptim.graph.DGraph.isIsostructuralTo(), denoptim.graph.DGraph.removeBranchStartingAt(), denoptim.graph.DGraph.sameAs(), denoptim.graph.DGraphTest.testDetectSymVertexSets(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_symmetry(), and denoptim.graph.DGraphTest.testReplaceVertex().

Here is the caller graph for this function:

◆ getSymSetsIterator()

◆ getSymVerticesForVertex()

List< Vertex > denoptim.graph.DGraph.getSymVerticesForVertex ( Vertex  v)
Parameters
vthe vertex for which we want the list of symmetric vertices.
Returns
a list that includes v but can be empty.

Definition at line 335 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.Template.getSymmetricAPSets(), denoptim.graph.DGraph.getSymmetricSubGraphs(), denoptim.graph.DGraph.insertVertex(), denoptim.graph.DGraph.removeVertexAndWeld(), denoptim.graph.DGraph.replaceVertex(), and denoptim.ga.GraphOperationsTest.testExtendGraph().

Here is the caller graph for this function:

◆ getTemplateJacket()

Template denoptim.graph.DGraph.getTemplateJacket ( )
Returns
the template that contains this graph or null.

Definition at line 6932 of file DGraph.java.

References denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), and denoptim.ga.GraphOperations.performMutation().

Here is the caller graph for this function:

◆ getUniqueAPIndex()

int denoptim.graph.DGraph.getUniqueAPIndex ( )
protected

Definition at line 4051 of file DGraph.java.

References denoptim.graph.DGraph.apCounter.

Referenced by denoptim.graph.Vertex.getUniqueAPIndex().

Here is the caller graph for this function:

◆ getUsedRCVertices()

ArrayList< Vertex > denoptim.graph.DGraph.getUsedRCVertices ( )

Search for used ring closing vertices: vertices that contain only a RingClosingAttractor and are part of a DENOPTIMRing.

Returns
the list of ring closing vertices

Definition at line 1007 of file DGraph.java.

References denoptim.graph.DGraph.getFreeRCVertices(), and denoptim.graph.DGraph.getRCVertices().

Referenced by denoptim.ga.EAUtils.getCrowdedness().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVertexAtPosition()

Vertex denoptim.graph.DGraph.getVertexAtPosition ( int  pos)

Returns the vertex that is in the given position of the list of vertices belonging to this graph.

Parameters
posthe position in the list.
Returns
the vertex in the given position.

Definition at line 2514 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.ga.GraphOperations.addRing(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getBranchIdOfVertexAtPosition(), denoptim.graph.DGraph.getEmbeddedGraphInClone(), denoptim.fragspace.FragmentSpaceTest.getExpectedTemplate(), denoptim.utils.GraphUtils.getLabel(), denoptim.graph.DGraph.getSourceVertex(), denoptim.gui.GraphVertexMolViewerPanel.loadDnGraphToViewer(), denoptim.ga.EAUtilsTest.prepare(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.graph.DGraph.sameAs(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards(), denoptim.ga.EAUtilsTest.testBuildGraphFromTemplateScaffold(), denoptim.ga.PopulationTest.testClone(), denoptim.graph.DGraphTest.testClone(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.DGraphTest.testConvertSymmetricLabelsToSymmetricSets(), denoptim.ga.EAUtilsTest.testCrowdingProbability(), denoptim.graph.DGraphTest.testDetectSymVertexSets(), denoptim.ga.GraphOperationsTest.testExtendGraph(), denoptim.graph.DGraphTest.testExtractSubgraph(), denoptim.graph.DGraphTest.testExtractSubgraphFromCollection(), denoptim.graph.DGraphTest.testFindSymmetrySetsOfChildVertexes(), denoptim.graph.DGraphTest.testFindVertex(), denoptim.graph.DGraphTest.testGetChildrenTree(), denoptim.graph.DGraphTest.testGetChildrenTreeWithBranchIdentifier(), denoptim.graph.DGraphTest.testGetEdgesWithSrcOrTrg(), denoptim.graph.DGraphTest.testGetInterfaceAPs(), denoptim.utils.GraphConversionToolTest.testGetJGraphKernelFromGraph(), denoptim.graph.DGraphTest.testGetLevel(), denoptim.graph.DGraphTest.testGetSourceVertex(), denoptim.graph.DGraphTest.testGetSubgraphAPs(), denoptim.graph.DGraphTest.testGetSymmetricSubGraphs(), denoptim.graph.DGraphTest.testIsIsostructuralTo(), denoptim.fragspace.GraphLinkFinderTest.testLinkFromVertex(), denoptim.ga.GraphOperationsTest.testLocateCompatibleXOverPoints(), denoptim.graph.rings.PathSubGraphTest.testMakePathSubGraph(), denoptim.ga.XoverSiteTest.testProjectToClonedGraphs(), denoptim.graph.DGraphTest.testReplaceSubGraph(), denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate(), denoptim.graph.DGraphTest.testReplaceVertex(), denoptim.graph.DGraphTest.testReplaceVertex_inRing(), denoptim.graph.TemplateTest.testSameAPClass(), denoptim.graph.DGraphTest.testSymmetricSetLabels(), and denoptim.ga.PopulationTest.testXOverCompatibility().

Here is the caller graph for this function:

◆ getVertexCount()

int denoptim.graph.DGraph.getVertexCount ( )

Definition at line 2672 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.ga.EAUtils.buildGraph(), denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.ga.GraphOperations.deleteChain(), denoptim.ga.GraphOperations.deleteFragment(), denoptim.graph.Vertex.getMutationTypes(), denoptim.gui.GraphVertexMolViewerPanel.loadDnGraphToViewer(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.graph.DGraph.renumberVerticesGetMap(), denoptim.graph.DGraph.sameAs(), denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph(), denoptim.graph.DGraphTest.testClone(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.DGraphTest.testEmbedPatternsInTemplates(), denoptim.ga.GraphOperationsTest.testExtendGraph(), denoptim.ga.GraphOperationsTest.testExtractPattern_singleRingSystem(), denoptim.graph.DGraphTest.testExtractSubgraphFromCollection(), denoptim.graph.DGraphTest.testGetLevel(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_linearities(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_ScaffoldingPolicy(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_Symmetry(), denoptim.graph.DGraphTest.testRemoveCapping(), denoptim.graph.DGraphTest.testRemoveUnusedRCVs(), denoptim.graph.DGraphTest.testRemoveVertex(), denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate(), and denoptim.ga.PopulationTest.testXOverCompatibility().

Here is the caller graph for this function:

◆ getVertexList()

List< Vertex > denoptim.graph.DGraph.getVertexList ( )

Definition at line 719 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.molecularmodeling.MultiMolecularModelBuilder.buildMulti3DStructure(), denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), denoptim.graph.DGraph.containsAtoms(), denoptim.gui.GraphViewerPanel.convertDnGraphToGSGraph(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.detectSymVertexSets(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.findVertices(), denoptim.ga.EAUtils.foundForbiddenEnd(), denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.ga.GraphOperationsTest.getExpectedSubgraphs(), denoptim.graph.DGraph.getHeavyAtomsCount(), denoptim.utils.GraphConversionTool.getJGraphFromGraph(), denoptim.utils.GraphConversionTool.getJGraphKernelFromGraph(), denoptim.graph.DGraph.graphNeedsCappingGroups(), denoptim.graph.DGraph.hasForbiddenEnd(), denoptim.graph.DGraph.hasScaffoldTypeVertex(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.renumberVerticesGetMap(), denoptim.ga.EAUtils.selectNonScaffoldNonCapVertex(), denoptim.graph.DGraph.DENOPTIMGraphSerializer.serialize(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph(), denoptim.graph.DGraphTest.testEmbedPatternsInTemplates(), denoptim.graph.DGraphTest.testFindVertex(), denoptim.fragspace.FragmentSpaceTest.testFusedRingAddedToScaffoldLibrary(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_linearities(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_ScaffoldingPolicy(), denoptim.graph.DGraphTest.testReplaceVertex(), and denoptim.graph.DGraphTest.testSymmetricSetLabels().

Here is the caller graph for this function:

◆ getVertexWithId()

Vertex denoptim.graph.DGraph.getVertexWithId ( long  vid)

Searches for a vertex with the given identifier.

Parameters
vidthe identifier
Returns
the first vertex found with such identifier, or null if no such identifier is found.

Definition at line 2582 of file DGraph.java.

References denoptim.graph.DGraph.gVertices, and denoptim.graph.DGraph.indexOfVertexWithID().

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.graph.DGraph.clone(), denoptim.ga.GraphOperations.deleteChain(), denoptim.ga.GraphOperations.deleteFragment(), denoptim.graph.DGraph.DENOPTIMGraphDeserializer.deserialize(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.ga.GraphOperations.extendGraph(), denoptim.graph.DGraph.getAPOnLeftVertexID(), denoptim.graph.DGraph.getEdgeWithParent(), denoptim.programs.genetweeker.GeneOpsRunner.getEmbeddedVertex(), denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), denoptim.fragspace.FragsCombinationIterator.next(), denoptim.ga.GraphOperations.performCrossover(), denoptim.ga.GraphOperations.rebuildBranch(), denoptim.graph.DGraph.removeCappingGroups(), denoptim.graph.DGraph.removeOrphanBranchStartingAt(), denoptim.graph.DGraph.removeSymmetryRedundantIds(), denoptim.graph.DGraphTest.testExtractSubgraphFromCollection(), and denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_symmetry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphNeedsCappingGroups()

boolean denoptim.graph.DGraph.graphNeedsCappingGroups ( FragmentSpace  fragSpace)

Checks the graph for unused APs that need to be capped.

Returns
true if the graph has at least one AP that needs to be capped

Definition at line 4064 of file DGraph.java.

References denoptim.fragspace.FragmentSpace.getAPClassOfCappingVertex(), and denoptim.graph.DGraph.getVertexList().

Referenced by denoptim.combinatorial.GraphBuildingTask.call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasForbiddenEnd()

boolean denoptim.graph.DGraph.hasForbiddenEnd ( FragmentSpaceParameters  fsSettings)

Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused.

Returns
true if a forbidden end is found

Definition at line 5686 of file DGraph.java.

References denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.graph.DGraph.getVertexList(), and denoptim.graph.APClass.toString().

Referenced by denoptim.graph.DGraph.checkConsistency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasOrEmbedsRings()

boolean denoptim.graph.DGraph.hasOrEmbedsRings ( )

Check for rings in this graph and in any graph that is embedded at any level in any vertex of this graph.

Does not consider any graph that embeds this graph.

Returns
true if there are rings in this graph or in embedded graphs.

Definition at line 906 of file DGraph.java.

References denoptim.graph.Template.getInnerGraph(), denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.gVertices, and denoptim.graph.DGraph.hasOrEmbedsRings().

Referenced by denoptim.molecularmodeling.MultiMolecularModelBuilder.buildMulti3DStructure(), denoptim.molecularmodeling.ChemicalObjectModel.ChemicalObjectModel(), and denoptim.graph.DGraph.hasOrEmbedsRings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasRings()

boolean denoptim.graph.DGraph.hasRings ( )

Check for rings in this graph.

Does not cross the template-barrier, i.e., ignores any ring that is embedded at any level in any vertex of this graph, neither in any graph that embeds this graph.

Returns
true if there are rings in this graph.

Definition at line 892 of file DGraph.java.

References denoptim.graph.DGraph.gRings.

◆ hasScaffoldTypeVertex()

boolean denoptim.graph.DGraph.hasScaffoldTypeVertex ( )

Checks if this graph contains a scaffold vertex.

Returns
true if there is a scaffold vertex.

Definition at line 6909 of file DGraph.java.

References denoptim.graph.DGraph.getVertexList(), and denoptim.graph.Vertex.BBType.SCAFFOLD.

Referenced by denoptim.graph.DGraph.embedPatternsInTemplates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasSymmetricAP()

boolean denoptim.graph.DGraph.hasSymmetricAP ( )

Definition at line 286 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.fragspace.FragsCombinationIterator.next().

Here is the caller graph for this function:

◆ hasSymmetryInvolvingVertex()

boolean denoptim.graph.DGraph.hasSymmetryInvolvingVertex ( Vertex  v)

Definition at line 293 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.ga.GraphOperations.deleteChain(), denoptim.ga.GraphOperations.deleteFragment(), denoptim.ga.GraphOperations.extendGraph(), denoptim.ga.GraphOperations.rebuildBranch(), and denoptim.graph.DGraph.removeBranchStartingAt().

Here is the caller graph for this function:

◆ indexOf()

int denoptim.graph.DGraph.indexOf ( Vertex  v)

Returns the index of a vertex in the list of vertices of this graph.

Parameters
vthe vertex to search
Returns
the index of the vertex in the list of vertices.

Definition at line 2569 of file DGraph.java.

References denoptim.graph.DGraph.gVertices.

Referenced by denoptim.ga.GraphOperations.addRing(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getEmbeddedGraphInClone(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.ga.GraphOperations.performMutation(), and denoptim.ga.GraphOperationsTest.testLocateCompatibleXOverPoints().

Here is the caller graph for this function:

◆ indexOfVertexWithID()

int denoptim.graph.DGraph.indexOfVertexWithID ( long  vid)

Returns the position of the first vertex that has the given ID.

Parameters
vidthe vertedID of the vertex we are looking for.
Returns
the index in the list of vertices.

Definition at line 2598 of file DGraph.java.

References denoptim.graph.Vertex.getVertexId(), and denoptim.graph.DGraph.gVertices.

Referenced by denoptim.graph.DGraph.getVertexWithId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertSingleVertex()

boolean denoptim.graph.DGraph.insertSingleVertex ( Edge  edge,
Vertex  newLink,
LinkedHashMap< AttachmentPoint, AttachmentPoint apMap 
) throws DENOPTIMException

Inserts a given vertex in between two vertices connected by the given edge.

This method reproduces the change of vertex on all symmetric sites.

Parameters
edgethe edge where to insert the new vertex.
newLinkthe new vertex to be inserted.
apMapthe mapping of attachment points needed to install the new vertex and connect it to the rest of the graph. The syntax of this map must be:
  • keys: the APs originally involved in making the edge given as parameter,
  • values: the APs in the new vertex.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMException

Definition at line 2440 of file DGraph.java.

References denoptim.graph.DGraph.addEdge(), denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.containsVertex(), denoptim.graph.DGraph.gEdges, denoptim.graph.AttachmentPoint.getBondType(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.isVertexInRing(), denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, denoptim.graph.DGraph.removeEdge(), and denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.graph.DGraph.insertVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertVertex()

boolean denoptim.graph.DGraph.insertVertex ( Edge  edge,
int  bbId,
BBType  bbt,
LinkedHashMap< AttachmentPoint, Integer >  apMap,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Inserts a given vertex in between two vertices connected by the given edge.

This method reproduces the change of vertex on all symmetric sites.

Parameters
edgethe edge where to insert the new vertex.
bbIdthe building block Id of the building blocks that will be inserted.
bbtthe type of building block to be inserted.
apMapthe mapping of attachment points needed to install the new building block and connect it to the rest of the graph. The syntax of this map must be:
  • keys: the APs originally involved in making the edge given as parameter,
  • values: the 0-based index of the AP in the new building block that will be inserted.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMException

Definition at line 2360 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.DGraph.addSymmetricSetOfVertices(), denoptim.utils.GraphUtils.ensureVertexIDConsistency(), denoptim.graph.DGraph.gEdges, denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.getMaxVertexId(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.DGraph.getSymVerticesForVertex(), denoptim.graph.Edge.getTrgAP(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.DGraph.insertSingleVertex(), and denoptim.graph.Vertex.newVertexFromLibrary().

Referenced by denoptim.ga.GraphOperations.extendLink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isIsomorphicTo()

boolean denoptim.graph.DGraph.isIsomorphicTo ( DGraph  other)

Checks if this graph is "DENOPTIM-isomorphic" to the other one given.

"DENOPTIM-isomorphic" is a DENOPTIM-specific definition of
graph isomorphism that differs from the most common meaning of isomorphism in graph theory. In general, graph are considered undirected when evaluating DENOPTIM-isomorphism. Next, since a graph is effectively a spanning tree (ST_i={{vertices}, {acyclic edges}}) with a set of fundamental cycles (FC_i={C_1, C_2,...C_n}), any graph G={ST_i,FC_i} that contains one or more cycles can be represented in multiple ways, G={ST_j,FC_j} or G={ST_k,FC_k}, that differ by the position of the chord/s and by the corresponding pair of ring-closing vertices between which each chord is defined. The DENOPTIM-isomorphism for two graph G1 and G2 is given by the common graph theory isomorphism between two undirected graphs U1 and U2 build respectively from G1 and G2 with the convention defined in GraphConversionTool#getJGraphFromGraph(DGraph). Finally,

  • vertices are compared excluding their vertex ID, i.e., Vertex#sameAs()
  • edges are considered undirected and compared considering the BondType and the identity of the attachment points connected thereby. This latter point has an important implication: two apparently equal graphs (same vertices that are connected to each other forming the same vertex-chains) can be non-isomorphic when the APs used to connect two vertices are not the same. Chemically, this means the stereochemistry around one or both vertices, is different in the two graphs. Therefore two otherwise equal-looking graphs can very well be, de facto, not isomorphic.

This method makes use of the Vento-Foggia VF2 algorithm (see DOI:10.1109/TPAMI.2004.75) as provided by JGraphT library in VF2GraphIsomorphismInspector.

Detection of isomorphism can be very slow for pathological cases and for graphs with large symmetric systems! TODO: consider adding a runtime limit or a further simplification/speed-up exploiting symmetry. The symmetry, however, does not help detecting isomorphism between a graph with symmetric branches and its isomorphic analog that is fully asymmetric.

Parameters
otherthe graph to be compared with this.
Returns
true is this graph is isomorphic to the other.

Definition at line 3453 of file DGraph.java.

References denoptim.graph.simplified.UndirectedEdge.compare(), denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getGraphOwner(), denoptim.utils.GraphConversionTool.getJGraphFromGraph(), denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.jGraph, and denoptim.graph.Vertex.sameAs().

Referenced by denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), denoptim.ga.GraphOperations.processPermutationOfEndPoints(), denoptim.programs.graphlisthandler.GraphListsHandler.runProgram(), denoptim.programs.isomorphism.Isomorphism.runProgram(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.graph.DGraphTest.testExtractSubgraph(), denoptim.graph.DGraphTest.testGraphIsomorphism(), denoptim.graph.DGraphTest.testIsIsostructuralTo(), denoptim.graph.DGraphTest.testReplaceSubGraph(), and denoptim.graph.DGraphTest.testReplaceVertex_inRing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isIsostructuralTo()

boolean denoptim.graph.DGraph.isIsostructuralTo ( DGraph  other)

Checks if this graph is "DENOPTIM-isostructural" to the other one given.

"DENOPTIM-isostructural" means that the two graphs are isomorfic when:

  • the comparison of the vertices considers any implementation of Vertex equals to itself unless two vertices differ by the return value of Vertex#isRCV(),
  • the comparison of the vertices considers only the type of bond the edge corresponds to (if any),
  • free AttachmentPoints that are marked as required in either graph are reflected in the other.
Parameters
other
Returns

Definition at line 3580 of file DGraph.java.

References denoptim.graph.simplified.Node.compare(), denoptim.graph.simplified.NodeConnection.compare(), denoptim.graph.simplified.Node.getDNPVertex(), denoptim.graph.Vertex.getGraphOwner(), denoptim.utils.GraphConversionTool.getJGraphKernelFromGraph(), denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.jGraphKernel, and denoptim.graph.simplified.Node.REFTOVERTEXKERNEL.

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), and denoptim.graph.DGraphTest.testIsIsostructuralTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isReversible()

boolean denoptim.graph.DGraph.isReversible ( FragmentSpace  fragSpace)

Checks is the every edge in the graph can be defined in the opposite direction according to the APClass compatibility rules.

Note that the reversions operation on a branched subgraph generates a graph with multiple source vertices, which is not allowed. Yet, the reversion is formally possible.

Returns
true if the all edges can be reverted and retain consistency with APClass compatibility rules.

Definition at line 7054 of file DGraph.java.

References denoptim.graph.DGraph.gEdges.

◆ isVertexIDInRing()

boolean denoptim.graph.DGraph.isVertexIDInRing ( int  vid)

Definition at line 924 of file DGraph.java.

References denoptim.graph.DGraph.gRings.

◆ isVertexInRing()

◆ makeAllGraphsWithDifferentRingSets()

ArrayList< DGraph > denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets ( RunTimeParameters  settings) throws DENOPTIMException

Evaluates the possibility of closing rings in this graph and generates all alternative graphs resulting by different combinations of rings.

Returns
true unless no ring can be set up even if required
Exceptions
denoptim.exception.DENOPTIMException

Definition at line 5589 of file DGraph.java.

References denoptim.graph.DGraph.addRing(), denoptim.graph.Ring.addVertex(), denoptim.graph.rings.RingClosureParameters.allowRingClosures(), denoptim.graph.rings.RingClosureParameters.buildChelatesMode, denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), denoptim.graph.DGraph.clone(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.utils.RotationalSpaceUtils.defineRotatableBonds(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.rings.CyclicGraphHandler.getPossibleCombinationOfRings(), denoptim.fragspace.FragmentSpaceParameters.getRotSpaceDefFile(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.graph.DGraph.getVertexWithId(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.graph.DGraph.renumberVerticesGetMap(), denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), denoptim.graph.Ring.setBondType(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setRings(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().

Referenced by denoptim.combinatorial.GraphBuildingTask.call().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reassignSymmetricLabels()

void denoptim.graph.DGraph.reassignSymmetricLabels ( )
protected

Marks the vertices of this graph with a string that is consistent for all vertices that belong to symmetric sets.

All vertices will get a label, whether they belong to a symmetric set or not. The label is places in the vertex property DENOPTIMConstants#VRTSYMMSETID. Any previous labeling is ignored and overwritten.

Definition at line 1568 of file DGraph.java.

References denoptim.graph.DGraph.getSymSetsIterator(), denoptim.graph.DGraph.gVertices, and denoptim.constants.DENOPTIMConstants.VRTSYMMSETID.

Referenced by denoptim.graph.DGraph.replaceVertex(), denoptim.graph.DGraphTest.testReplaceSubGraph(), and denoptim.graph.DGraphTest.testSymmetricSetLabels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeBranchStartingAt() [1/2]

boolean denoptim.graph.DGraph.removeBranchStartingAt ( Vertex  v) throws DENOPTIMException

Deletes the branch, i.e., the specified vertex and its children.

Updates symmetry accordingly, but does not remove symmetric branches.

Parameters
vidthe vertexID of the root of the branch. We'll remove also this vertex.
Returns
true if operation is successful
Exceptions
DENOPTIMException

Definition at line 4821 of file DGraph.java.

References denoptim.graph.DGraph.removeEdge(), and denoptim.graph.DGraph.removeOrphanBranchStartingAt().

Here is the call graph for this function:

◆ removeBranchStartingAt() [2/2]

boolean denoptim.graph.DGraph.removeBranchStartingAt ( Vertex  v,
boolean  symmetry 
) throws DENOPTIMException

Deletes the branch, i.e., the specified vertex and its children.

Parameters
vidthe vertexID of the root of the branch. We'll remove also this vertex.
symmetryuse true to enforce deletion of all symmetric vertices.
Returns
true if operation is successful.
Exceptions
DENOPTIMException

Definition at line 4788 of file DGraph.java.

References denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.hasSymmetryInvolvingVertex(), and denoptim.graph.DGraph.removeBranchStartingAt().

Referenced by denoptim.ga.GraphOperations.deleteFragment(), denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.removeBranchStartingAt(), and denoptim.graph.Template.removeProjectionOfInnerAP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCappingGroups() [1/2]

void denoptim.graph.DGraph.removeCappingGroups ( )

Remove all capping groups on this graph.

Definition at line 4156 of file DGraph.java.

References denoptim.graph.DGraph.gVertices, and denoptim.graph.DGraph.removeCappingGroups().

Referenced by denoptim.graph.DGraph.removeCappingGroups(), and denoptim.graph.DGraph.removeCappingGroupsFromChilds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCappingGroups() [2/2]

void denoptim.graph.DGraph.removeCappingGroups ( List< Vertex lstVerts)

Remove capping groups that belong to this graph and are in the given list.

Parameters
lstVertsthe list of vertices to analyze.

Definition at line 4114 of file DGraph.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.Vertex.getVertexId(), denoptim.graph.DGraph.getVertexWithId(), denoptim.graph.DGraph.isVertexInRing(), and denoptim.graph.DGraph.removeVertex().

Referenced by denoptim.graph.DGraphTest.testRemoveCapping().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCappingGroupsFromChilds()

void denoptim.graph.DGraph.removeCappingGroupsFromChilds ( List< Vertex lstVerts)

Definition at line 4142 of file DGraph.java.

References denoptim.graph.DGraph.getChildVertices(), and denoptim.graph.DGraph.removeCappingGroups().

Referenced by denoptim.graph.DGraph.replaceSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCappingGroupsOn()

void denoptim.graph.DGraph.removeCappingGroupsOn ( Vertex  vertex)

Remove capping groups on the given vertex of this graph.

Definition at line 4084 of file DGraph.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.getChildVertices(), denoptim.graph.DGraph.isVertexInRing(), and denoptim.graph.DGraph.removeVertex().

Referenced by denoptim.graph.DGraphTest.testRemoveCapping().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeChainUpToBranching()

boolean denoptim.graph.DGraph.removeChainUpToBranching ( Vertex  v,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Mutates the graph by removing the chain where a given vertex is located up to the first branching (i.e., to non-capping group) on either side.

The graph is updated accordingly. In particular, the direction of edges in the surviving graph and the definition of fundamental cycles are changed to reflect the change of spanning tree.

Parameters
vthe vertex from which we start detecting a chain
Returns
true if successful.
Exceptions
DENOPTIMExceptionis any assumption on the healthy structure of this graph is not verified.

Definition at line 4878 of file DGraph.java.

References denoptim.graph.DGraph.addEdge(), denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.DGraph.addRing(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.Template.getAttachmentPoints(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.DGraph.getAvailableAPs(), denoptim.graph.Edge.getBondType(), denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.Vertex.getCappedAPCountThroughout(), denoptim.graph.Vertex.getChilddren(), denoptim.graph.Vertex.getChildrenThroughout(), denoptim.graph.Vertex.getEdgeToParent(), denoptim.graph.Vertex.getEdgeWith(), denoptim.graph.Vertex.getFreeAPCountThroughout(), denoptim.graph.Template.getInnerAPFromOuterAP(), denoptim.graph.DGraph.getLevel(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Ring.getPositionOf(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.Ring.getSize(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Ring.getVertexAtPosition(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.APClass.isCPMapCompatibleWith(), denoptim.graph.DGraph.removeEdge(), denoptim.graph.Template.removeProjectionOfInnerAP(), denoptim.graph.DGraph.removeRing(), denoptim.graph.DGraph.removeSymmetrySet(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.graph.DGraph.templateJacket, and denoptim.io.DenoptimIO.writeGraphToJSON().

Referenced by denoptim.ga.GraphOperations.deleteChain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeEdge()

void denoptim.graph.DGraph.removeEdge ( Edge  edge)

Removes an edge and update the free valences of the attachment points that were originally involved in this edge.

Parameters
edge

Definition at line 2620 of file DGraph.java.

References denoptim.graph.DGraph.gEdges, denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, and denoptim.graph.AttachmentPoint.setUser().

Referenced by denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraph.removeBranchStartingAt(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.DGraph.replaceSingleSubGraph(), and denoptim.graph.EdgeTest.testConnectionDeconnectionLoop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeOrphanBranchStartingAt()

boolean denoptim.graph.DGraph.removeOrphanBranchStartingAt ( Vertex  v) throws DENOPTIMException

Deletes the branch, i.e., the specified vertex and its children.

This method does not cross template boundaries, thus all children belong to the same graph. Symmetry relations are updated accordingly.

Parameters
vidthe vertexID of the root of the branch. We'll remove also this vertex.
allowOrphanuse true to allow removal of branches starting with a vertex that has no edge to a parent.
Returns
true if operation is successful
Exceptions
DENOPTIMException

Definition at line 4847 of file DGraph.java.

References denoptim.graph.DGraph.getChildrenTree(), denoptim.graph.DGraph.getVertexWithId(), and denoptim.graph.DGraph.removeVertex().

Referenced by denoptim.graph.DGraph.removeBranchStartingAt(), and denoptim.graph.DGraph.removeSingleVertexAndWeld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeRing()

void denoptim.graph.DGraph.removeRing ( Ring  ring)

Definition at line 2637 of file DGraph.java.

References denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.removeVertex(), and denoptim.ga.GraphOperationsTest.testExtractPattern_returnsEmptyListIfNoRings().

Here is the caller graph for this function:

◆ removeSingleVertexAndWeld()

boolean denoptim.graph.DGraph.removeSingleVertexAndWeld ( Vertex  vertex,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Remove a given vertex belonging to this graph and re-connects the resulting graph branches as much as possible.

Parameters
vertexthe vertex currently belonging to this graph and to be replaced.
Returns
true if the operation is successful.
Exceptions
DENOPTIMException

Definition at line 1247 of file DGraph.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.containsVertex(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.APClass.getBondType(), denoptim.graph.Vertex.getFreeAPThroughout(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.AttachmentPoint.getLinkedAP(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.DGraph.getSourceVertex(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, denoptim.graph.DGraph.removeEdge(), denoptim.graph.DGraph.removeOrphanBranchStartingAt(), denoptim.graph.Template.removeProjectionOfInnerAP(), denoptim.graph.DGraph.removeRing(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.symVertices, denoptim.graph.DGraph.templateJacket, and denoptim.graph.Template.updateInnerApID().

Referenced by denoptim.graph.DGraph.removeSingleVertexAndWeld(), and denoptim.graph.DGraph.removeVertexAndWeld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSymmetryRedundance()

void denoptim.graph.DGraph.removeSymmetryRedundance ( List< Vertex list)

Remove all but one of the symmetry-related partners in a list of vertices.

The vertices must belong to this graph.

Parameters
listvertices to be purged.

Definition at line 6392 of file DGraph.java.

References denoptim.graph.DGraph.getSymSetsIterator().

Referenced by denoptim.graph.DGraph.findVertices(), and denoptim.graph.DGraph.removeSymmetryRedundantIds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSymmetryRedundantIds()

void denoptim.graph.DGraph.removeSymmetryRedundantIds ( ArrayList< Long >  list)

Remove all but one of the symmetry-related partners in a given list of vertex IDs.

The vertices must belong to this graph.

Parameters
listthe list of vertex IDs to be purged.

Definition at line 6426 of file DGraph.java.

References denoptim.graph.DGraph.getVertexWithId(), and denoptim.graph.DGraph.removeSymmetryRedundance().

Here is the call graph for this function:

◆ removeSymmetrySet()

void denoptim.graph.DGraph.removeSymmetrySet ( SymmetricVertexes  ss)

Removed the given symmetric set, if present.

Parameters
ssthe symmetric relation to be removed.

Definition at line 620 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.removeChainUpToBranching().

Here is the caller graph for this function:

◆ removeVertex()

void denoptim.graph.DGraph.removeVertex ( Vertex  vertex)

Remove a vertex from this graph.

This method removes also edges and rings that involve the given vertex. Symmetric sets of vertices are corrected accordingly: they are removed if there is only one remaining vertex in the set, or purged from the vertex being removed.

Parameters
vertexthe vertex to remove.

Definition at line 1119 of file DGraph.java.

References denoptim.graph.DGraph.gEdges, denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.Edge.getSrcVertex(), denoptim.graph.Edge.getTrgVertex(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.isVertexInRing(), denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, denoptim.graph.DGraph.removeEdge(), denoptim.graph.DGraph.removeRing(), denoptim.graph.Vertex.resetGraphOwner(), and denoptim.graph.DGraph.symVertices.

Referenced by denoptim.ga.GraphOperations.addRing(), denoptim.graph.DGraph.extractSubgraph(), denoptim.ga.GraphOperationsTest.getExpectedSubgraphs(), denoptim.fragspace.FragmentSpaceTest.getExpectedTemplate(), denoptim.gui.GUIGraphHandler.initialize(), denoptim.graph.DGraph.removeCappingGroups(), denoptim.graph.DGraph.removeCappingGroupsOn(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.removeOrphanBranchStartingAt(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceUnusedRCVsWithCapps(), and denoptim.graph.DGraphTest.testRemoveVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeVertexAndWeld()

boolean denoptim.graph.DGraph.removeVertexAndWeld ( Vertex  vertex,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Remove a given vertex belonging to this graph and re-connects the resulting graph branches as much as possible.

This method reproduces the change of vertex on all symmetric sites.

Parameters
oldLinkthe vertex currently belonging to this graph and to be replaced.
Returns
true if the operation is successful.
Exceptions
DENOPTIMException

Definition at line 1195 of file DGraph.java.

References denoptim.utils.GraphUtils.ensureVertexIDConsistency(), denoptim.graph.DGraph.getMaxVertexId(), denoptim.graph.DGraph.getSymVerticesForVertex(), denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.gVertices, denoptim.graph.AttachmentPoint.hasConnectedSrcAtom(), denoptim.graph.AttachmentPoint.hasSameSrcAtom(), and denoptim.graph.DGraph.removeSingleVertexAndWeld().

Referenced by denoptim.ga.GraphOperations.deleteLink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renumberGraphVertices()

void denoptim.graph.DGraph.renumberGraphVertices ( )

Reassign vertex IDs to all vertices of this graph.

The old IDs are stored in the vertex property DENOPTIMConstants#STOREDVID.

Definition at line 5283 of file DGraph.java.

References denoptim.graph.DGraph.renumberVerticesGetMap().

Referenced by denoptim.graph.DGraph.appendGraphOnAP(), denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.graph.DGraph.editGraph(), denoptim.fragspace.FragmentSpaceTest.getExpectedTemplate(), denoptim.ga.GraphOperationsTest.getFusedRings(), denoptim.fragspace.FragmentSpaceTest.getTestCase(), denoptim.ga.GraphOperationsTest.getThreeCycle(), denoptim.ga.PopulationTest.makeGraphA(), denoptim.ga.PopulationTest.makeGraphB(), denoptim.ga.PopulationTest.makeGraphC(), denoptim.ga.PopulationTest.makeGraphD(), denoptim.ga.PopulationTest.makeGraphF(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphA(), denoptim.graph.DGraphTest.makeTestGraphB(), denoptim.graph.DGraphTest.makeTestGraphC(), denoptim.graph.DGraphTest.makeTestGraphD(), denoptim.graph.DGraphTest.makeTestGraphDSub1(), denoptim.graph.DGraphTest.makeTestGraphDSub2(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphE(), denoptim.graph.DGraphTest.makeTestGraphE(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphF(), denoptim.graph.DGraphTest.makeTestGraphH(), denoptim.graph.DGraphTest.makeTestGraphI(), denoptim.graph.DGraphTest.makeTestGraphJ(), denoptim.graph.DGraphTest.makeTestGraphK(), denoptim.graph.DGraphTest.makeTestGraphL(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.programs.genetweeker.GeneOpsRunner.runXOver(), and denoptim.graph.DGraph.DENOPTIMGraphSerializer.serialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renumberVerticesGetMap()

Map< Long, Long > denoptim.graph.DGraph.renumberVerticesGetMap ( )

Reassign vertex IDs to a graph.

The old IDs are stored in the vertex property DENOPTIMConstants#STOREDVID.

Returns
map with old IDs as key and new IDs as values.

Definition at line 5296 of file DGraph.java.

References denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.DGraph.getVertexCount(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.Vertex.setProperty(), denoptim.graph.Vertex.setVertexId(), and denoptim.constants.DENOPTIMConstants.STOREDVID.

Referenced by denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), and denoptim.graph.DGraph.renumberGraphVertices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reorderVertexList()

static void denoptim.graph.DGraph.reorderVertexList ( DGraph  g)
staticprivate

Sets the vertex at the lowest level as the scaffold, changes the
directions of edges so that the scaffold is the source, and changes the levels of the graph's other vertices to be consistent with the new scaffold.

Parameters
gGraph to fix.

Definition at line 4717 of file DGraph.java.

References denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.getSourceVertex(), and denoptim.graph.DGraph.setScaffold().

Referenced by denoptim.graph.DGraph.extractPattern().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceSingleSubGraph()

boolean denoptim.graph.DGraph.replaceSingleSubGraph ( List< Vertex subGrpVrtxs,
DGraph  newSubGraph,
LinkedHashMap< AttachmentPoint, AttachmentPoint apMap 
) throws DENOPTIMException

Replaced the subgraph represented by a given collection of vertices that belong to this graph.

This method does not project the change of vertex on symmetric sites, and does not alter the symmetric sets. To properly manage symmetry, you should run DGraph#reassignSymmetricLabels() on newSubGraph prior to calling this method, and, after running this method, call DGraph#convertSymmetricLabelsToSymmetricSets() on this graph. This strategy reflects the fact that multiple sub-graph replacements can introduce vertices that are symmetric throughout these newly inserted subgraphs, thus a single subgraph replacement cannot know the complete list of symmetric vertices. Therefore, the handling of the symmetry is left outside of the subgraph replacement operation.

Parameters
subGrpVrtxsthe vertices currently belonging to this graph and to be replaced. We assume these collection of vertices is a connected subgraph, i.e., all vertices are reachable by one single vertex via a directed path that does not involve any other vertex not included in this collections.
newSubGraphthe graph that will be attached on this graph. No copying or cloning: such graph contains the actual vertices that will become part of this graph.
apMapmapping of attachment points belonging to any vertex in subGrpVrtxs to attachment points in newSubGraph.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMException

Definition at line 1954 of file DGraph.java.

References denoptim.graph.DGraph.addEdge(), denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.DGraph.addRing(), denoptim.graph.DGraph.addVertex(), denoptim.graph.Template.clearIAtomContainer(), denoptim.graph.DGraph.containsVertex(), denoptim.graph.Edge.getBondType(), denoptim.graph.AttachmentPoint.getEdgeUser(), denoptim.graph.AttachmentPoint.getLinkedAP(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.rings.PathSubGraph.getVertecesPath(), denoptim.graph.DGraph.gVertices, denoptim.graph.AttachmentPoint.isAvailable(), denoptim.graph.DGraph.jGraph, denoptim.graph.DGraph.jGraphKernel, denoptim.graph.DGraph.removeEdge(), denoptim.graph.Template.removeProjectionOfInnerAP(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.DGraph.templateJacket, and denoptim.graph.Template.updateInnerApID().

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.graph.DGraphTest.testIsIsostructuralTo(), denoptim.graph.DGraphTest.testReplaceSubGraph(), and denoptim.graph.DGraphTest.testReplaceSubGraph_inTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceSubGraph()

boolean denoptim.graph.DGraph.replaceSubGraph ( List< Vertex subGrpVrtxs,
DGraph  incomingGraph,
LinkedHashMap< AttachmentPoint, AttachmentPoint apMap,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Replaced the subgraph represented by a given collection of vertices that belong to this graph.

This method reproduces the change of vertex on all symmetric sites, where a site is identified by a symmetrically identified reflection of the subgraph to replace, which are identified using symmetric sets.

Parameters
subGrpVrtxsthe vertices currently belonging to this graph and to
be replaced. We assume these collection of vertices is a connected graph, i.e., all vertices are reachable by one single vertex via a directed path that does not involve any other vertex not included in this collections.
newSubGraphthe graph that will be used to create the new branch replacing the old one. Vertices of such branch will be cloned to create the new vertices to be added to this graph.
apMapmapping of attachment points belonging to any vertex in subGrpVrtxs to attachment points in newSubGraph.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMExceptionis capping groups are the only vertices in the subgraph.

Definition at line 1680 of file DGraph.java.

References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.utils.GraphUtils.ensureVertexIDConsistency(), denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.getChilddren(), denoptim.graph.AttachmentPoint.getIndexInOwner(), denoptim.graph.DGraph.getMaxVertexId(), denoptim.graph.DGraph.getSymmetricSubGraphs(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.removeCappingGroupsFromChilds(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.DGraph.renumberGraphVertices(), and denoptim.graph.DGraph.replaceSingleSubGraph().

Referenced by denoptim.graph.DGraph.embedPatternsInTemplates(), and denoptim.ga.GraphOperations.performCrossover().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceUnusedRCVsWithCapps()

void denoptim.graph.DGraph.replaceUnusedRCVsWithCapps ( FragmentSpace  fragSpace) throws DENOPTIMException

Removes unused ring-closing vertices.

If the resulting free AP needs to be capped, then the proper capping group is places where a ring-closing vertex once stood.

Parameters
fragSpacethe fragment space defining how capping is configured.
Exceptions
DENOPTIMException

Definition at line 1526 of file DGraph.java.

References denoptim.graph.DGraph.appendVertexOnAP(), denoptim.graph.Vertex.getAP(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.DGraph.getRCVertices(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.DGraph.removeVertex(), and denoptim.graph.Vertex.setVertexId().

Referenced by denoptim.combinatorial.GraphBuildingTask.call(), denoptim.ga.OffspringEvaluationTask.call(), denoptim.programs.fitnessevaluator.FitnessEvaluationTask.call(), and denoptim.graph.DGraphTest.testRemoveUnusedRCVs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceVertex() [1/2]

boolean denoptim.graph.DGraph.replaceVertex ( Vertex  vertex,
int  bbId,
BBType  bbt,
LinkedHashMap< Integer, Integer >  apIdMap,
boolean  symmetry,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Replaced a given vertex belonging to this graph with a new vertex generated specifically for this purpose.

Parameters
vertexthe vertex currently belonging to this graph and to be replaced.
bbIdthe building block Id of the building blocks that will replace the original vertex.
bbtthe type of building block to be used to replace the original vertex.
apMapthe mapping of attachment points needed to install the new vertex in the slot of the old one and recreate the edges to the rest of the graph.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMException

Definition at line 2282 of file DGraph.java.

References denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.graph.DGraph.DGraph(), denoptim.utils.GraphUtils.ensureVertexIDConsistency(), denoptim.graph.Vertex.getAP(), denoptim.graph.DGraph.getMaxVertexId(), denoptim.graph.DGraph.getSymVerticesForVertex(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.gVertices, denoptim.graph.Vertex.newVertexFromLibrary(), denoptim.graph.DGraph.reassignSymmetricLabels(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.graph.DGraph.replaceSingleSubGraph(), and denoptim.graph.Vertex.setMutationTypes().

Here is the call graph for this function:

◆ replaceVertex() [2/2]

boolean denoptim.graph.DGraph.replaceVertex ( Vertex  vertex,
int  bbId,
BBType  bbt,
LinkedHashMap< Integer, Integer >  apIdMap,
FragmentSpace  fragSpace 
) throws DENOPTIMException

Replaced a given vertex belonging to this graph with a new vertex generated specifically for this purpose.

This method reproduces the change of vertex on all symmetric sites.

Parameters
vertexthe vertex currently belonging to this graph and to be replaced.
bbIdthe building block Id of the building blocks that will replace the original vertex.
bbtthe type of building block to be used to replace the original vertex.
apMapthe mapping of attachment points needed to install the new vertex in the slot of the old one and recreate the edges to the rest of the graph.
Returns
true if the substitution is successful.
Exceptions
DENOPTIMException

Definition at line 2258 of file DGraph.java.

References denoptim.graph.DGraph.replaceVertex().

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.ga.GraphOperations.substituteLink(), denoptim.graph.DGraphTest.testReplaceVertex(), and denoptim.graph.DGraphTest.testReplaceVertex_inRing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameAs()

boolean denoptim.graph.DGraph.sameAs ( DGraph  other,
StringBuilder  reason 
)

Compare this and another graph ignoring the vertex IDs.

This method looks into the structure of the graphs to determine if the two graphs have the same spanning tree, same symmetric sets, and same rings set, despite having different vertex IDs. Does not check for alternative permutations nor alternatives spanning trees so it returns false for isomorphic graphs that are represented by different spanning trees.

Parameters
otherthe other graph to be compared with this graph
Returns
true if the two graphs represent the same system

Definition at line 3665 of file DGraph.java.

References denoptim.graph.DGraph.compareGraphNodes(), denoptim.graph.DGraph.getEdgeCount(), denoptim.graph.DGraph.getRingCount(), denoptim.graph.DGraph.getRings(), denoptim.graph.DGraph.getRingsInvolvingVertex(), denoptim.graph.DGraph.getSymmetricSetCount(), denoptim.graph.DGraph.getSymSetForVertex(), denoptim.graph.DGraph.getSymSetsIterator(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.getVertexCount(), and denoptim.graph.DGraph.sameAsRings().

Referenced by denoptim.ga.Population.getXoverPartners(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards(), denoptim.graph.DGraphTest.testSameAs_DiffRings(), denoptim.graph.DGraphTest.testSameAs_DiffSymmSet(), denoptim.graph.DGraphTest.testSameAs_DiffVertex(), denoptim.graph.DGraphTest.testSameAs_DisorderRings(), denoptim.graph.DGraphTest.testSameAs_Equal(), denoptim.graph.DGraphTest.testSameAs_SameRings(), denoptim.graph.DGraphTest.testSameAs_SameSymmSet(), and denoptim.io.DenoptimIOTest.testSerializeDeserializeDENOPTIMGraphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameAsRings()

boolean denoptim.graph.DGraph.sameAsRings ( StringBuilder  reason,
Map< Vertex, Vertex vertexMap,
Ring  rT,
Vertex  vhT,
Vertex  vtT,
Ring  rO 
)
private

Definition at line 3775 of file DGraph.java.

References denoptim.graph.Ring.getHeadVertex(), denoptim.graph.Ring.getSize(), denoptim.graph.Ring.getTailVertex(), and denoptim.graph.Ring.getVertexAtPosition().

Referenced by denoptim.graph.DGraph.sameAs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCandidateClosableChains()

void denoptim.graph.DGraph.setCandidateClosableChains ( ArrayList< ClosableChain closableChains)

Definition at line 705 of file DGraph.java.

References denoptim.graph.DGraph.closableChains.

Referenced by denoptim.ga.EAUtils.buildGraph(), and denoptim.graph.DGraph.clone().

Here is the caller graph for this function:

◆ setCandidateOwner()

void denoptim.graph.DGraph.setCandidateOwner ( Candidate  candidate)

Sets the reference to the candidate item that is defined by this graph.

Parameters
candidatethe candidate owner.

Definition at line 239 of file DGraph.java.

References denoptim.graph.DGraph.candidate.

Referenced by denoptim.graph.Candidate.Candidate().

Here is the caller graph for this function:

◆ setEdgeList()

void denoptim.graph.DGraph.setEdgeList ( ArrayList< Edge edges)

◆ setGraphId()

◆ setLocalMsg()

◆ setRings()

void denoptim.graph.DGraph.setRings ( ArrayList< Ring rings)

Definition at line 696 of file DGraph.java.

References denoptim.graph.DGraph.gRings, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.graph.DGraph.clone(), and denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets().

Here is the caller graph for this function:

◆ setScaffold()

static void denoptim.graph.DGraph.setScaffold ( Vertex  v)
static

Update the graph so that the vertex argument is at the scaffold level i.e.

is the source of this graph. The vertex list of this graph will also be reordered in a way that corresponds to the BFS.

Parameters
vvertex to set as scaffold

Definition at line 6863 of file DGraph.java.

References denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.AttachmentPoint.getEdgeUser(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.DGraph.setVertexList().

Referenced by denoptim.ga.GraphOperationsTest.getFusedRings(), and denoptim.graph.DGraph.reorderVertexList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSymmetricVertexSets()

void denoptim.graph.DGraph.setSymmetricVertexSets ( List< SymmetricVertexes symVertices)

Definition at line 647 of file DGraph.java.

References denoptim.graph.DGraph.symVertices.

Referenced by denoptim.graph.DGraph.clone().

Here is the caller graph for this function:

◆ setTemplateJacket()

void denoptim.graph.DGraph.setTemplateJacket ( Template  template)

Sets the reference to a template that embeds this graph, i.e., this graph's "jacket" template.

Parameters
denoptimTemplatethe jacket template

Definition at line 6922 of file DGraph.java.

Referenced by denoptim.graph.Template.setInnerGraph().

Here is the caller graph for this function:

◆ setVertexList()

void denoptim.graph.DGraph.setVertexList ( ArrayList< Vertex vertices)

Definition at line 678 of file DGraph.java.

References denoptim.graph.DGraph.gVertices, denoptim.graph.DGraph.jGraph, and denoptim.graph.DGraph.jGraphKernel.

Referenced by denoptim.graph.DGraph.setScaffold().

Here is the caller graph for this function:

◆ storeCurrentVertexIDs()

void denoptim.graph.DGraph.storeCurrentVertexIDs ( )

Copies the current vertexID of each vertex into a property of the vertex itself.

Use this to keep a memory of the vertex IDs in any given moment.

Definition at line 6982 of file DGraph.java.

References denoptim.graph.DGraph.gVertices, and denoptim.constants.DENOPTIMConstants.STOREDVID.

◆ toJson()

String denoptim.graph.DGraph.toJson ( )

Produces a string that represents this graph and that adheres to the JSON format.

Returns
the JSON format as a single string

Definition at line 6660 of file DGraph.java.

References denoptim.json.DENOPTIMgson.getWriter().

Referenced by denoptim.ga.OffspringEvaluationTask.call(), denoptim.graph.Candidate.getFitnessProviderOutputRepresentation(), denoptim.graph.DGraphTest.testFromToJSON(), and denoptim.io.DenoptimIOTest.testSerializeDeserializeDENOPTIMGraphs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

Member Data Documentation

◆ apCounter

AtomicInteger denoptim.graph.DGraph.apCounter = new AtomicInteger(1)
private

Generator of unique AP identifiers within this graph.

Definition at line 171 of file DGraph.java.

Referenced by denoptim.graph.DGraph.ensureUniqueApIDs(), and denoptim.graph.DGraph.getUniqueAPIndex().

◆ candidate

Candidate denoptim.graph.DGraph.candidate
package

Reference to the candidate entity owning this graph, or null.

Definition at line 144 of file DGraph.java.

Referenced by denoptim.graph.DGraph.getCandidateOwner(), and denoptim.graph.DGraph.setCandidateOwner().

◆ closableChains

◆ gEdges

◆ graphId

◆ gRings

◆ gVertices

List<Vertex> denoptim.graph.DGraph.gVertices
package

The vertices belonging to this graph.

Definition at line 106 of file DGraph.java.

Referenced by denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.cleanup(), denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.containsOrEmbedsVertex(), denoptim.graph.DGraph.containsVertex(), denoptim.graph.DGraph.containsVertexID(), denoptim.graph.DGraph.convertSymmetricLabelsToSymmetricSets(), denoptim.graph.DGraph.DGraph(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.DGraph.extractSubgraph(), denoptim.graph.DGraph.getAttachmentPoints(), denoptim.graph.DGraph.getBranchIdOfVertex(), denoptim.graph.DGraph.getMaxVertexId(), denoptim.graph.DGraph.getMutableSites(), denoptim.graph.Template.getMutationSites(), denoptim.graph.DGraph.getRCVertices(), denoptim.graph.DGraph.getSourceVertex(), denoptim.graph.DGraph.getVertexAtPosition(), denoptim.graph.DGraph.getVertexCount(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.DGraph.getVertexWithId(), denoptim.graph.DGraph.hasOrEmbedsRings(), denoptim.graph.DGraph.indexOf(), denoptim.graph.DGraph.indexOfVertexWithID(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraph.reassignSymmetricLabels(), denoptim.graph.DGraph.removeCappingGroups(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), denoptim.graph.DGraph.removeVertex(), denoptim.graph.DGraph.removeVertexAndWeld(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.DGraph.replaceSubGraph(), denoptim.graph.DGraph.replaceVertex(), denoptim.graph.DGraph.DENOPTIMGraphSerializer.serialize(), denoptim.graph.DGraph.setVertexList(), denoptim.graph.DGraph.storeCurrentVertexIDs(), denoptim.graph.DGraphTest.testClone(), denoptim.graph.DGraphTest.testReplaceVertex(), denoptim.graph.DGraph.toString(), and denoptim.graph.Template.updateMutTypeToFixedSTructure().

◆ jGraph

◆ jGraphKernel

◆ localMsg

String denoptim.graph.DGraph.localMsg
package

A free-format string used to record simple properties in the graph.

For instance, whether this graph comes from a given initial population or is generated anew from scratch, or from mutation/crossover.

Definition at line 139 of file DGraph.java.

Referenced by denoptim.graph.DGraph.clone(), denoptim.graph.DGraph.DGraph(), denoptim.graph.DGraph.getLocalMsg(), denoptim.graph.DGraph.setLocalMsg(), and denoptim.graph.DGraphTest.testClone().

◆ symVertices

◆ templateJacket


The documentation for this class was generated from the following file: