$darkmode
DENOPTIM
denoptim.graph.Edge Class Reference

This class represents the edge between two vertices. More...

Collaboration diagram for denoptim.graph.Edge:
[legend]

Classes

enum  BondType
 Possible chemical bond types an edge can represent. More...
 
class  DENOPTIMEdgeSerializer
 

Public Member Functions

 Edge (AttachmentPoint srcAP, AttachmentPoint trgAP, BondType bondType)
 Constructor for an edge that connects two APs. More...
 
 Edge (AttachmentPoint srcAP, AttachmentPoint trgAP)
 Constructor for an edge that connects two APs. More...
 
AttachmentPoint getSrcAP ()
 
AttachmentPoint getSrcAPThroughout ()
 
AttachmentPoint getTrgAPThroughout ()
 
AttachmentPoint getTrgAP ()
 
long getSrcVertex ()
 
int getSrcAPID ()
 
int getTrgAPID ()
 
long getTrgVertex ()
 
APClass getSrcAPClass ()
 
APClass getTrgAPClass ()
 
BondType getBondType ()
 
boolean sameAs (Edge other, StringBuilder reason)
 Compares this and another edge ignoring edge and vertex IDs. More...
 
int compareAsUndirected (Edge other)
 Compares this and another edge ignoring the directionality of both, i.e., as if both edges were undirected. More...
 
String toString ()
 
void flipEdge ()
 Exchanges source and target vertices and respective APs of this edge. More...
 

Private Attributes

AttachmentPoint srcAP
 Attachment point at source end. More...
 
AttachmentPoint trgAP
 Attachment point at target end. More...
 
BondType bondType = BondType.UNDEFINED
 The bond type associated with the connection between the fragments. More...
 

Detailed Description

This class represents the edge between two vertices.

Definition at line 37 of file Edge.java.

Constructor & Destructor Documentation

◆ Edge() [1/2]

denoptim.graph.Edge.Edge ( AttachmentPoint  srcAP,
AttachmentPoint  trgAP,
BondType  bondType 
)

Constructor for an edge that connects two APs.

The number of connections available in the APs is reduced upon creation of the edge and according the the bond type.

Parameters
srcAPattachment point at source end
trgAPattachment point at target end
bondTypedefines what kind of bond type this edge should be converted to when converting a graph into a chemical representation.

Definition at line 67 of file Edge.java.

References denoptim.graph.Edge.bondType, denoptim.graph.AttachmentPoint.setUser(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.

Here is the call graph for this function:

◆ Edge() [2/2]

denoptim.graph.Edge.Edge ( AttachmentPoint  srcAP,
AttachmentPoint  trgAP 
)

Constructor for an edge that connects two APs.

We assume a single bond. The number of connections available in the APs is reduced upon creation of the edge and according the the bond type.

Parameters
srcAPattachment point at source end
trgAPattachment point at target end

Definition at line 87 of file Edge.java.

References denoptim.graph.Edge.srcAP, denoptim.graph.Edge.trgAP, and denoptim.graph.Edge.BondType.UNDEFINED.

Member Function Documentation

◆ compareAsUndirected()

int denoptim.graph.Edge.compareAsUndirected ( Edge  other)

Compares this and another edge ignoring the directionality of both, i.e., as if both edges were undirected.

Ranking and comparison is based on an invariant lexicographic string that combines, for each side of the edge, the following information:

  1. type of the building block reached,
  2. the ID of the building block,
  3. the index of the attachment point.

Only for edges that link equivalent building blocks via the corresponding APs (i.e., edges belonging to the same invariant class), the bond type is considered as the final comparison criterion.

Parameters
otheredge to compare with this.
Returns
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Definition at line 221 of file Edge.java.

References denoptim.graph.Edge.getBondType(), denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.AttachmentPoint.getIndexInOwner(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.

Referenced by denoptim.graph.EdgeTest.testUndirectedComparison().

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

◆ flipEdge()

void denoptim.graph.Edge.flipEdge ( )

Exchanges source and target vertices and respective APs of this edge.

Definition at line 292 of file Edge.java.

References denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.

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

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

◆ getBondType()

◆ getSrcAP()

◆ getSrcAPClass()

APClass denoptim.graph.Edge.getSrcAPClass ( )

Definition at line 150 of file Edge.java.

References denoptim.graph.AttachmentPoint.getAPClass(), and denoptim.graph.Edge.srcAP.

Referenced by denoptim.graph.rings.RingSizeManager.evaluateRCVPair(), and denoptim.ga.GraphOperations.isCrossoverPossible().

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

◆ getSrcAPID()

int denoptim.graph.Edge.getSrcAPID ( )

Definition at line 129 of file Edge.java.

References denoptim.graph.Vertex.getIndexOfAP(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Edge.srcAP.

Referenced by denoptim.graph.DGraph.editGraph(), denoptim.graph.rings.RingSizeManager.evaluateRCVPair(), denoptim.graph.DGraph.getBondingAPIndex(), denoptim.ga.GraphOperations.getFragmentForClosableChain(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), and denoptim.graph.Edge.toString().

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

◆ getSrcAPThroughout()

AttachmentPoint denoptim.graph.Edge.getSrcAPThroughout ( )

Definition at line 101 of file Edge.java.

References denoptim.graph.AttachmentPoint.getEmbeddedAP(), and denoptim.graph.Edge.srcAP.

Referenced by denoptim.graph.Vertex.getAPsFromChildren(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.isSrcInUserThroughout(), and denoptim.graph.AttachmentPointTest.testGetEmbeddedAP().

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

◆ getSrcVertex()

long denoptim.graph.Edge.getSrcVertex ( )

Definition at line 122 of file Edge.java.

References denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.Edge.srcAP.

Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.rings.PathSubGraph.findPath(), denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.getBondingAPIndex(), denoptim.graph.DGraph.getEdgesWithChild(), denoptim.graph.DGraph.getIndexOfEdgesWithChild(), denoptim.ga.GraphOperations.rebuildBranch(), and denoptim.graph.DGraph.removeVertex().

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

◆ getTrgAP()

◆ getTrgAPClass()

APClass denoptim.graph.Edge.getTrgAPClass ( )

Definition at line 157 of file Edge.java.

References denoptim.graph.AttachmentPoint.getAPClass(), and denoptim.graph.Edge.trgAP.

Referenced by denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), and denoptim.ga.GraphOperations.isCrossoverPossible().

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

◆ getTrgAPID()

int denoptim.graph.Edge.getTrgAPID ( )

Definition at line 136 of file Edge.java.

References denoptim.graph.Vertex.getIndexOfAP(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.Edge.trgAP.

Referenced by denoptim.graph.DGraph.getBondingAPIndex(), denoptim.ga.GraphOperations.getFragmentForClosableChain(), denoptim.graph.rings.PathSubGraph.PathSubGraph(), and denoptim.graph.Edge.toString().

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

◆ getTrgAPThroughout()

AttachmentPoint denoptim.graph.Edge.getTrgAPThroughout ( )

Definition at line 108 of file Edge.java.

References denoptim.graph.AttachmentPoint.getEmbeddedAP(), and denoptim.graph.Edge.trgAP.

Referenced by denoptim.graph.Vertex.getAPsFromChildren(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), and denoptim.graph.AttachmentPointTest.testGetEmbeddedAP().

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

◆ getTrgVertex()

long denoptim.graph.Edge.getTrgVertex ( )

Definition at line 143 of file Edge.java.

References denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.Edge.trgAP.

Referenced by denoptim.graph.DGraph.changeSignOfVertexID(), denoptim.graph.DGraph.compareGraphNodes(), denoptim.graph.DGraph.fixEdgeDirections(), denoptim.graph.DGraph.getBondingAPIndex(), and denoptim.graph.DGraph.removeVertex().

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

◆ sameAs()

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

Compares this and another edge ignoring edge and vertex IDs.

Parameters
otheredge to compare against
reasonstring builder used to build the message clarifying the reason for returning false.
Returns
true if the two edges represent the same connection even if the vertex IDs are different.

Definition at line 180 of file Edge.java.

References denoptim.graph.Edge.getBondType(), denoptim.graph.Edge.getSrcAP(), denoptim.graph.Edge.getTrgAP(), and denoptim.graph.Edge.sameAs().

Referenced by denoptim.graph.Edge.sameAs(), denoptim.graph.EdgeTest.testSameAs_DiffBndTyp(), and denoptim.graph.EdgeTest.testSameAs_Equal().

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

◆ toString()

String denoptim.graph.Edge.toString ( )

Definition at line 265 of file Edge.java.

References denoptim.graph.Edge.bondType, denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Edge.getSrcAPID(), denoptim.graph.Edge.getTrgAPID(), denoptim.graph.Vertex.getVertexId(), denoptim.graph.Edge.srcAP, and denoptim.graph.Edge.trgAP.

Here is the call graph for this function:

Member Data Documentation

◆ bondType

BondType denoptim.graph.Edge.bondType = BondType.UNDEFINED
private

The bond type associated with the connection between the fragments.

Definition at line 52 of file Edge.java.

Referenced by denoptim.graph.Edge.Edge(), denoptim.graph.Edge.getBondType(), and denoptim.graph.Edge.toString().

◆ srcAP

◆ trgAP


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