hey everyone i have a task to write down the adjacency matrix of this graph and im a little unsure how it should look
i hope there is someone that can help,
thx in advance:-/

Googling leads me to believe that an adjacency matrix of a graph is an n by n matrix where n is the number of vertexes represented in the graph. The rows represent which vertex you are starting from. The columns represent which matrix you are going to. If you can get from one given vertex to another then the cell in the row representing the vertex you are starting from and the column where you are goint to has the value of one. If not the cell has a value of zero. Arrows represent you can go this direction, but not the the reverse.

The attached file has 6 vertexes. So the adjacency matrix for the graph would be 6 by 6. As I understand it the matrix itself would be:

011000
000011
000110
100000
000101
000000

In C++ this could be represented as 2 dimensional array of int.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.