Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SccCounterOutput< NodeIndex > Struct Template Reference

#include <strongly_connected_components.h>

Public Member Functions

void emplace_back (NodeIndex const *b, NodeIndex const *e)
 
int size () const
 
void clear ()
 

Public Attributes

int number_of_components = 0
 

Detailed Description

template<typename NodeIndex>
struct SccCounterOutput< NodeIndex >

A simple custom output class that just counts the number of SCC. Not allocating many vectors can save both space and speed if your graph is large.

Note
If this matters, you probably don't want to use vector<vector<int>> as an input either. See StaticGraph in ortools/graph/graph.h for an efficient graph data structure compatible with this algorithm.

Definition at line 83 of file strongly_connected_components.h.

Member Function Documentation

◆ clear()

template<typename NodeIndex >
void SccCounterOutput< NodeIndex >::clear ( )
inline

Definition at line 91 of file strongly_connected_components.h.

◆ emplace_back()

template<typename NodeIndex >
void SccCounterOutput< NodeIndex >::emplace_back ( NodeIndex const * b,
NodeIndex const * e )
inline

Definition at line 85 of file strongly_connected_components.h.

◆ size()

template<typename NodeIndex >
int SccCounterOutput< NodeIndex >::size ( ) const
inline

This is just here so this class can transparently replace a code that use vector<vector<int>> as an SccOutput, and get its size with size().

Definition at line 90 of file strongly_connected_components.h.

Member Data Documentation

◆ number_of_components

template<typename NodeIndex >
int SccCounterOutput< NodeIndex >::number_of_components = 0

Definition at line 84 of file strongly_connected_components.h.


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