- std::vector< V > ap, bp;
- this->_Path( ap, a );
- this->_Path( bp, b );
-
- // Ignore common part
- typename std::vector< V >::const_reverse_iterator raIt, rbIt;
- raIt = ap.rbegin( );
- 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
- typename std::vector< V >::const_iterator iaIt = ap.begin( );
- for( ; iaIt != ap.end( ) && *iaIt != *raIt; ++iaIt )
- path.push_back( *iaIt );
-
- // Add part from b
- for( ; rbIt != bp.rend( ); ++rbIt )
- path.push_back( *rbIt );
- }
- else
+ vertices.push_back( it );
+ it = p;
+ p = this->GetParent( it );
+
+ } // elihw
+ vertices.push_back( it );
+
+ if( path.IsNull( ) )
+ path = _TPath::New( );
+ for( auto v = vertices.begin( ); v != vertices.end( ); ++v )
+ path->AddVertex( *v );
+}
+
+// -------------------------------------------------------------------------
+template< class _TVertex, class _TPath, class _TSuperclass >
+void fpa::Base::MinimumSpanningTree< _TVertex, _TPath, _TSuperclass >::
+GetPath(
+ typename _TPath::Pointer& path, const _TVertex& a, const _TVertex& b
+ ) const
+{
+ static const unsigned long _inf =
+ std::numeric_limits< unsigned long >::max( );
+
+ if( path.IsNull( ) )
+ path = _TPath::New( );
+ typename _TPath::Pointer pa, pb;
+ this->GetPath( pa, a );
+ this->GetPath( pb, b );
+ if( pa->GetSize( ) > 0 && pb->GetSize( ) > 0 )