original_string: protected function searchComponent($start)
      {
          if (!isset($this->component)) {
              $this->component = $start;
          }
  
          if (isset($this->graph[$start]['paths'])) {
              return null;
          }
  
          $this->graph[$start]['paths'] = array();
          $this->graph[$start]['component'] = $this->component;
          $this->state['components'][$this->component][] = $start;
  
          if (isset($this->graph[$start]['edges'])) {
              foreach ($this->graph[$start]['edges'] as $end => $v) {
                  $this->graph[$start]['paths'][$end] = $v;
                  if (isset($this->graph[$end]['component']) && $this->component != $this->graph[$end]['component']) {
                      $new_component = $this->graph[$end]['component'];
                      foreach ($this->state['components'][$this->component] as $vertex) {
                          $this->graph[$vertex]['component'] = $new_component;
                          $this->state['components'][$new_component][] = $vertex;
                      }
                      unset($this->state['components'][$this->component]);
                      $this->component = $new_component;
                  }
  
                  if (isset($this->graph[$end])) {
                      $this->searchComponent($end);
                      $this->graph[$start]['paths'] += $this->graph[$end]['paths'];
                  }
              }
          }
  
          foreach ($this->graph[$start]['paths'] as $end => $v) {
              if (isset($this->graph[$end])) {
                  $this->graph[$end]['reverse_paths'][$start] = $v;
              }
          }
  
          $this->state['last_visit_order'][] = $start;
          return null;
      }
code: protected function searchComponent($start)
      {
          if (!isset($this->component)) {
              $this->component = $start;
          }
  
          if (isset($this->graph[$start]['paths'])) {
              return null;
          }
  
          $this->graph[$start]['paths'] = array();
          $this->graph[$start]['component'] = $this->component;
          $this->state['components'][$this->component][] = $start;
  
          if (isset($this->graph[$start]['edges'])) {
              foreach ($this->graph[$start]['edges'] as $end => $v) {
                  $this->graph[$start]['paths'][$end] = $v;
                  if (isset($this->graph[$end]['component']) && $this->component != $this->graph[$end]['component']) {
                      $new_component = $this->graph[$end]['component'];
                      foreach ($this->state['components'][$this->component] as $vertex) {
                          $this->graph[$vertex]['component'] = $new_component;
                          $this->state['components'][$new_component][] = $vertex;
                      }
                      unset($this->state['components'][$this->component]);
                      $this->component = $new_component;
                  }
  
                  if (isset($this->graph[$end])) {
                      $this->searchComponent($end);
                      $this->graph[$start]['paths'] += $this->graph[$end]['paths'];
                  }
              }
          }
  
          foreach ($this->graph[$start]['paths'] as $end => $v) {
              if (isset($this->graph[$end])) {
                  $this->graph[$end]['reverse_paths'][$start] = $v;
              }
          }
  
          $this->state['last_visit_order'][] = $start;
          return null;
      }
code_tokens: protected function searchComponent ( $ start ) { if ( ! isset ( $ this -> component ) ) { $ this -> component = $ start ; } if ( isset ( $ this -> graph [ $ start ] [ 'paths' ] ) ) { return null ; } $ this -> graph [ $ start ] [ 'paths' ] = array ( ) ; $ this -> graph [ $ start ] [ 'component' ] = $ this -> component ; $ this -> state [ 'components' ] [ $ this -> component ] [ ] = $ start ; if ( isset ( $ this -> graph [ $ start ] [ 'edges' ] ) ) { foreach ( $ this -> graph [ $ start ] [ 'edges' ] as $ end => $ v ) { $ this -> graph [ $ start ] [ 'paths' ] [ $ end ] = $ v ; if ( isset ( $ this -> graph [ $ end ] [ 'component' ] ) && $ this -> component != $ this -> graph [ $ end ] [ 'component' ] ) { $ new_component = $ this -> graph [ $ end ] [ 'component' ] ; foreach ( $ this -> state [ 'components' ] [ $ this -> component ] as $ vertex ) { $ this -> graph [ $ vertex ] [ 'component' ] = $ new_component ; $ this -> state [ 'components' ] [ $ new_component ] [ ] = $ vertex ; } unset ( $ this -> state [ 'components' ] [ $ this -> component ] ) ; $ this -> component = $ new_component ; } if ( isset ( $ this -> graph [ $ end ] ) ) { $ this -> searchComponent ( $ end ) ; $ this -> graph [ $ start ] [ 'paths' ] += $ this -> graph [ $ end ] [ 'paths' ] ; } } } foreach ( $ this -> graph [ $ start ] [ 'paths' ] as $ end => $ v ) { if ( isset ( $ this -> graph [ $ end ] ) ) { $ this -> graph [ $ end ] [ 'reverse_paths' ] [ $ start ] = $ v ; } } $ this -> state [ 'last_visit_order' ] [ ] = $ start ; return null ; }
docstring: Performs a depth-first search on a graph
  @param string $start
  @return null
docstring_tokens: Performs a depth - first search on a graph