Author Topic: How to find an Adjacency Matrix  (Read 13275 times)

0 Members and 6 Guests are viewing this topic.

Offline greg701

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 10
  • Rating: +0/-0
    • View Profile
How to find an Adjacency Matrix
« on: May 09, 2011, 02:09:28 pm »
Hi all I have a TI-Nspire (Non CAS)

I was wondering how (or whether) it would be possible to create a program which can find the adjacency matrix of a given matrix.

I have no idea even how to start this so any help in the right direction would be great.

Thanks

Greg

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: How to find an Adjacency Matrix
« Reply #1 on: May 09, 2011, 02:44:56 pm »
An adjacency matrix is a matrix representation of a graph...How do you intend to find an adjacency matrix of matrix?
There's something about Tuesday...


Pushpins 'n' stuff...


Offline greg701

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 10
  • Rating: +0/-0
    • View Profile
Re: How to find an Adjacency Matrix
« Reply #2 on: May 09, 2011, 03:35:45 pm »
Lol, typed the wrong thing... I mean I want to find the adjugate of the matrix.

Sorry it's been a long day x

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: How to find an Adjacency Matrix
« Reply #3 on: May 11, 2011, 04:23:33 pm »
Well, the easy way is

adjugate(a) = det(a)a-1

but this only works if a is invertible. If not, I guess you could just manually compute each cofactor:

Define adjugate(a)=
Func
   Local adj,c,i,j,k,n
   n:=rowDim(a)
   adj:=newMat(n,n)
   For i,1,n
      For j,1,n
         c:=a
         For k,1,n
            c[j,k]:=0
            c[k,i]:=0
         EndFor
         c[j,i]:=1
         adj[i,j]:=det(c)
      EndFor
   EndFor
   Return adj
EndFunc

Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo