indigoX
indigox::algorithm Namespace Reference

Classes

struct  access
 
class  CherryPicker
 CherryPicker parameterisation algorithm class. More...
 
struct  CMGCallback
 
struct  CMGPrintCallback
 
class  ConnectedSubgraphs
 Generate connected subgraphs in G. More...
 
class  IXAStarOptimisation
 
class  IXElectronAssigner
 
class  IXLocalOptimisation
 Local optimisation electron assignment algorithm. More...
 
struct  MappingCallback
 
struct  MGCallback
 
struct  MGPrintCallback
 
class  PriorityQueue
 
struct  QueueItem
 
struct  TraversalResults
 

Typedefs

using _ElectronAssigner = std::weak_ptr< IXElectronAssigner >
 
using AssignerAlgorithm = IXElectronAssigner::AssignerAlgorithm
 Type for the enum of available assignment algorithms. More...
 
using AssignMask = boost::dynamic_bitset<>
 Type of the mask used for assignments. More...
 
using ElectronAssigner = std::shared_ptr< IXElectronAssigner >
 
using key_t = uint32_t
 Type of the key for a score table. More...
 
using LocMask = boost::dynamic_bitset<>
 
using queue_t = std::priority_queue< QueueItem, std::vector< QueueItem >, std::greater< QueueItem > >
 
using score_t = uint64_t
 Type of the score of an electron assignment. More...
 
using ScoreTable = std::map< key_t, score_t >
 Type of a score table. More...
 

Functions

template<class V , class E , class S , class D , class VP , class EP , class Container >
int64_t AllCycles (graph::BaseGraph< V, E, S, D, VP, EP > &G, Container &ecycles)
 
template<class V , class E , class S , class D , class VP , class EP >
void AllSimplePaths (graph::BaseGraph< V, E, S, D, VP, EP > &G, V source, V target, std::vector< std::vector< E >> &paths, int64_t limit=-1)
 Find all the simple paths between two vertices. More...
 
template<class V , class E , class S , class D , class VP , class EP >
TraversalResults< V > BreadthFirstSearch (graph::BaseGraph< V, E, S, D, VP, EP > &G, V source=V(), int64_t limit=-1)
 
template<class V , class E , class S , class D , class VP , class EP , class Container >
int64_t ConnectedComponents (graph::BaseGraph< V, E, S, D, VP, EP > &G, Container &bits)
 
ElectronAssigner CreateElectronAssigner (const Molecule &m)
 Create an ElectronAssigner. More...
 
template<class V , class E , class S , class D , class VP , class EP , class Container >
int64_t CycleBasis (graph::BaseGraph< V, E, S, D, VP, EP > &G, Container &basis)
 
template<class V , class E , class S , class D , class VP , class EP >
TraversalResults< V > DepthFirstSearch (graph::BaseGraph< V, E, S, D, VP, EP > &G, V source=V(), int64_t limit=-1)
 Perform a breadth first search of G. More...
 
std::vector< std::vector< Atom > > OptimalChargeGroups (const Molecule &mol, int32_t limit=5)
 
template<class V , class E , class S , class D , class VP , class EP >
std::vector< E > ShortestPath (graph::BaseGraph< V, E, S, D, VP, EP > &G, V source, V target)
 Find the shortest path between two vertices. More...
 
void SubgraphIsomorphisms (graph::CondensedMolecularGraph &G1, graph::CondensedMolecularGraph &G2, CMGCallback &callback)
 
void SubgraphIsomorphisms (graph::MolecularGraph &G1, graph::MolecularGraph &G2, MGCallback &callback)
 

Typedef Documentation

◆ _ElectronAssigner

using _ElectronAssigner = std::weak_ptr<IXElectronAssigner>

◆ AssignerAlgorithm

Type for the enum of available assignment algorithms.

◆ AssignMask

using AssignMask = boost::dynamic_bitset<>

Type of the mask used for assignments.

◆ ElectronAssigner

using ElectronAssigner = std::shared_ptr<IXElectronAssigner>

◆ key_t

using key_t = uint32_t

Type of the key for a score table.

◆ LocMask

using LocMask = boost::dynamic_bitset<>

◆ queue_t

using queue_t = std::priority_queue<QueueItem, std::vector<QueueItem>, std::greater<QueueItem> >

◆ score_t

using score_t = uint64_t

Type of the score of an electron assignment.

◆ ScoreTable

using ScoreTable = std::map<key_t, score_t>

Type of a score table.

Function Documentation

◆ AllCycles()

int64_t indigox::algorithm::AllCycles ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
Container &  ecycles 
)

◆ AllSimplePaths()

void indigox::algorithm::AllSimplePaths ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
source,
target,
std::vector< std::vector< E >> &  paths,
int64_t  limit = -1 
)

Find all the simple paths between two vertices.

Determines all the paths between two vertices, using a modified depth-first search method. The order of the found paths is arbitary, though each path is ordered from source to target.

Parameters
Gthe graph to find paths in.
sourcethe source vertex.
targetthe target vertex.
[out]pathsvector to store all the found paths in.
limitthe maximum length path to return.
Exceptions
std::runtime_errorif you try something stupid.

◆ BreadthFirstSearch()

TraversalResults<V> indigox::algorithm::BreadthFirstSearch ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
source = V(),
int64_t  limit = -1 
)

◆ ConnectedComponents()

int64_t indigox::algorithm::ConnectedComponents ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
Container &  bits 
)

◆ CreateElectronAssigner()

ElectronAssigner indigox::algorithm::CreateElectronAssigner ( const Molecule m)
inline

Create an ElectronAssigner.

Friendship allows creation of electron assigner instances.

Parameters
mthe molecule this electron assigner is for.
Returns
a new ElectronAssigner.

◆ CycleBasis()

int64_t indigox::algorithm::CycleBasis ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
Container &  basis 
)

◆ DepthFirstSearch()

TraversalResults<V> indigox::algorithm::DepthFirstSearch ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
source = V(),
int64_t  limit = -1 
)

Perform a breadth first search of G.

Returns ordered vector of vertex pairs. Order is the order in which the vertices were discovered. First member of pair is the discovered vertex, second member is the predecessor of the discovered vertex. If no source is provided, the source is chosen arbitarily until all vertices have been discovered. If source is provided, only vertices within the component containing source will be searched. Limit is the limit of search depth.

◆ OptimalChargeGroups()

std::vector<std::vector<Atom> > indigox::algorithm::OptimalChargeGroups ( const Molecule mol,
int32_t  limit = 5 
)

◆ ShortestPath()

std::vector<E> indigox::algorithm::ShortestPath ( graph::BaseGraph< V, E, S, D, VP, EP > &  G,
source,
target 
)

Find the shortest path between two vertices.

Determines the shortest path between two vertices, using a bi-directional breadth-first search method. If there is no path between the vertices, the returned path is empty. The path is returned has the vertices to traverse in order from the source to the target. Multiple short paths may exist. This function returns only one of them.

Template Parameters
GraphTypethe type of the graph.
Parameters
Gthe graph to find the path in.
sourcethe source vertex.
targetthe target vertex.
Returns
the shortest path from source to target.
Exceptions
std::runtime_errorif source and target are the same vertex or either of them is not part of the graph.

◆ SubgraphIsomorphisms() [1/2]

void indigox::algorithm::SubgraphIsomorphisms ( graph::CondensedMolecularGraph G1,
graph::CondensedMolecularGraph G2,
CMGCallback callback 
)

◆ SubgraphIsomorphisms() [2/2]

void indigox::algorithm::SubgraphIsomorphisms ( graph::MolecularGraph G1,
graph::MolecularGraph G2,
MGCallback callback 
)