Can someone clarify this graph presentation for me? -


i have presentation of solid, cycle free graph forms follows:

  • remove vertices has degree of 1 (has 1 edge) 1 one
  • if there more 1 opinion, vertex lowest value removed
  • when vertex removed, vertex next me marked
  • this go on until graph has 1 vertex left

here's example:

         2   3            3
     \ /            /
  5   1    =>  5   1   =>   5   1  =>   5    =>  5
   \ /          \ /          \ /        \
    4            4            4         4

  

the presentation is:

1 1 4 5 

how can turn presentation f.e. following matrix:

   1  2  3  4  5  ----------------- 1  0  1  1  1  0 ----------------- 2  1  0  0  0  0 ----------------- 3  1  0  0  0  0 ----------------- 4  1  0  0  0  1 ----------------- 5  0  0  0  1  0 ----------------- 

i've been struggling while now, if can help, appreciate it!

it seems matrix:

   1  2  3  4  5  ----------------- 1  0  1  1  1  0 ----------------- 2  1  0  0  0  0 ----------------- 3  1  0  0  0  0 ----------------- 4  1  0  0  0  1 ----------------- 5  0  0  0  1  0 ----------------- 

is adjacency matrix of original graph.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -