- if( fa == fb )
- {
- // Get paths
- TVertices ap, bp;
- this->_Path( ap, a );
- this->_Path( bp, b );
-
- // Ignore common part: find common ancestor
- auto raIt = ap.rbegin( );
- auto rbIt = bp.rbegin( );
- while( *raIt == *rbIt && raIt != ap.rend( ) && rbIt != bp.rend( ) )
- {
- ++raIt;
- ++rbIt;
-
- } // elihw
- if( raIt != ap.rbegin( ) ) --raIt;
- if( rbIt != bp.rbegin( ) ) --rbIt;
-
- // Add part from a
- for( auto iaIt = ap.begin( ); iaIt != ap.end( ) && *iaIt != *raIt; ++iaIt )
- path.push_back( *iaIt );
-
- // Add part from b
- for( ; rbIt != bp.rend( ); ++rbIt )
- path.push_back( *rbIt );
- }
- else
+// -------------------------------------------------------------------------
+template< class _TVertex, class _TSuperclass >
+typename fpa::Base::MinimumSpanningTree< _TVertex, _TSuperclass >::
+TVertices fpa::Base::MinimumSpanningTree< _TVertex, _TSuperclass >::
+GetPath( const _TVertex& a, const _TVertex& b ) const
+{
+ static const unsigned long _inf =
+ std::numeric_limits< unsigned long >::max( );
+
+ TVertices path;
+ TVertices pa = this->GetPath( a );
+ TVertices pb = this->GetPath( b );
+ if( pa.size( ) > 0 && pb.size( ) > 0 )