8 #ifndef INCLUDE_MOLASSEMBLER_INNER_GRAPH_H
9 #define INCLUDE_MOLASSEMBLER_INNER_GRAPH_H
11 #include "boost/graph/adjacency_list.hpp"
19 namespace Molassembler {
30 Utils::ElementType elementType;
42 using BglType = boost::adjacency_list<
68 using Vertex = BglType::vertex_descriptor;
69 using Edge = BglType::edge_descriptor;
273 std::vector<AtomIndex>,
274 std::vector<AtomIndex>
309 return !(*
this == other);
317 boost::optional<RemovalSafetyData> removalSafetyDataOption;
318 boost::optional<Cycles> cyclesOption;
319 boost::optional<Cycles> etaPreservedCyclesOption;
321 inline void invalidate() {
322 removalSafetyDataOption = boost::none;
323 cyclesOption = boost::none;
324 etaPreservedCyclesOption = boost::none;
329 Cycles generateCycles_()
const;
330 Cycles generateEtaPreservedCycles_()
const;
Definition: PrivateGraph.h:316
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, VertexData, EdgeData > BglType
Definition: PrivateGraph.h:66
std::unordered_set< PrivateGraph::Vertex > articulationVertices
Articulation vertices cannot be removed without disconnecting the graph.
Definition: PrivateGraph.h:85
const Cycles & cycles() const
Access cycle information of the graph.
std::set< PrivateGraph::Edge > bridges
Bridges are edges that cannot be removed without disconnecting the graph.
Definition: PrivateGraph.h:87
Information stored at each graph vertex.
Definition: PrivateGraph.h:29
BglType & bgl()
Referential access to the underlying BGL graph.
const Cycles & etaPreservedCycles() const
Access cycle information of the graph with eta bonds preserved.
bool operator==(const PrivateGraph &other) const
Full isomorphism comparison including element types and bond orders.
Class to explore cyclic structure of molecules.
Edge edge(Vertex a, Vertex b) const
Make an edge descriptor from two vertex descriptors.
Vertex N() const
Number of vertices in the graph.
AtomEnvironmentComponents
For bitmasks grouping components of immediate atom environments.
Definition: Types.h:103
const RemovalSafetyData & removalSafetyData() const
Access removal safety information of the graph.
Data class to return removal safety information on the graph.
Definition: PrivateGraph.h:83
Wrapper class to make working with RDL in C++ more pleasant.
Definition: Cycles.h:44
void applyPermutation(const std::vector< Vertex > &permutation)
Apply a permutation to the graph.
unsigned connectedComponents() const
Number of connected components.
Information stored at each graph edge.
Definition: PrivateGraph.h:34
Homogeneous pair of iterators with begin and end member fns.
Definition: IteratorRange.h:26
void removeEdge(const Edge &e)
Removes an edge from the graph.
PrivateGraph()
Empty constructor.
std::pair< std::vector< AtomIndex >, std::vector< AtomIndex > > splitAlongBridge(Edge bridge) const
Determine which vertices belong to which side of a bridge edge.
BglType graph_
A directly owned Boost Library Graph.
Definition: PrivateGraph.h:336
void populateProperties() const
Access cycle information of the graph.
Vertex target(const Edge &edge) const
Target of an edge.
Vertex degree(Vertex a) const
Number of substituents of a vertex.
boost::optional< Edge > edgeOption(Vertex a, Vertex b) const
Get an edge descriptor from two vertex descriptors, get None if the edge doesn't exist.
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:24
bool canRemove(Vertex a) const
Determine whether a vertex can be safely removed.
BondType & bondType(const Edge &edge)
Fetch the bond type of an edge.
BondType
Discrete bond type numeration.
Definition: Types.h:26
BglType::edge_descriptor Edge
Definition: PrivateGraph.h:69
Properties properties_
Property caching.
Definition: PrivateGraph.h:338
static constexpr Vertex removalPlaceholder
Placeholder vertex index used to indicate that a vertex has been removed.
Definition: PrivateGraph.h:111
Edge addEdge(Vertex a, Vertex b, BondType bondType)
Add an edge to the graph.
void removeVertex(Vertex a)
Removes a vertex from the graph.
Utils::ElementType & elementType(Vertex a)
Fetches the element type of a vertex.
bool identicalGraph(const PrivateGraph &other) const
Checks whether all edges present in *this are present in other.
boost::optional< std::vector< AtomIndex > > modularIsomorphism(const PrivateGraph &other, AtomEnvironmentComponents components=AtomEnvironmentComponents::All) const
Modular isomorphism comparison.
BglType::vertex_descriptor Vertex
Definition: PrivateGraph.h:68
Vertex source(const Edge &edge) const
Source of an edge.
Vertex B() const
Number of edges in the graph.
void clearVertex(Vertex a)
Removes all bonds involving a vertex.
bool operator!=(const PrivateGraph &other) const
Full isomorphism comparison including element types and bond orders.
Definition: PrivateGraph.h:308
Vertex addVertex(Utils::ElementType elementType)
Add a (disconnected) vertex to the graph.