Questions tagged [adjacency-matrix]

A means of representing which vertices (or nodes) of a graph are adjacent to which other vertices.

The adjacency matrix of a finite graph G on n vertices is the n×n matrix where the non-diagonal entry aij is the number of edges from vertex i to vertex j, and the diagonal entry aii, depending on the convention, is either once or twice the number of edges (loops) from vertex i to itself.

Undirected graphs often use the latter convention of counting loops twice, whereas directed graphs typically use the former convention.
There exists a unique adjacency matrix for each isomorphism class of graphs (up to permuting rows and columns), and it is not the adjacency matrix of any other isomorphism class of graphs.
In the special case of a finite simple graph, the adjacency matrix is a (0,1)-matrix with zeros on its diagonal.

If the graph is undirected, the adjacency matrix is symmetric.

The relationship between a graph and the eigenvalues and eigenvectors of its adjacency matrix is studied in spectral graph theory.

http://en.wikipedia.org/wiki/Adjacency_matrix

900 questions
0
votes
2 answers

Optimizing an adjacency matrix creation from a 2D array of nodes

I am attempting to create an adjacency matrix from a 2D array of nodes. The adjacency matrix will be passed to a program that will cluster the nodes either through Spectral clustering algorithm Kmeans clustering algorithm **Node class ** …
0
votes
1 answer

Find adjacency matrix given a list of class labels

I have a list L of the items that bellong to the same class, L = [1 1 1 0 0 1 1] and I want to construct the adjacency matrix 'A' using the list L and not using any for loop, A = [1 1 1 0 0 0 0; 1 1 1 0 0 0 0; 1 1 1 0 0 0 0; 0 0 0 0…
Thoth
  • 993
  • 12
  • 36
0
votes
1 answer

Returning highest weighted edge in an Adjacency List

I'm trying to solve a practice question, writing a function that return the highest weighted edge from a directed weighted graph, represented as adjacency list. Since I have just finished this topic recently in my course, there is some confusion for…
AMH9
  • 179
  • 1
  • 4
  • 20
0
votes
1 answer

Vectorize compressed sparse matrix from array in Python

I am trying to apply graph theory methods to an image processing problem. I want to generate an adjacency matrix from an array containing the points I want to graph. I want to generate a complete graph of the points in the array. If I have N points…
carsonc
  • 85
  • 7
0
votes
1 answer

Length of MST, Adjacency Matrix

So here is the problem: Ignore problem 7, i blanked out irrelevant parts. I already know that the answer to Problem 8 is 13 as stated in the picture. But i dont know how to algorithmically come to this conclusion. I know how to create a MST from a…
user2327195
  • 263
  • 3
  • 10
0
votes
1 answer

Building and adjacency matrix

I was wondering if you guys can help me building an adjacency matrix. I have data in CVS format like this: Paper_ID Author 2 Foster-McGregor, N. 3 Van Houte, M. 4 van de Meerendonk, A. 5 Farla, K. 6 van Houte, M. 6 Siegel, M. 8 …
Mario GS
  • 859
  • 8
  • 22
0
votes
1 answer

speed up nested loops in R to create an adjacency matrix

I need some help parallelizing or speeding up the following nested loop: have a list of vertices (identified by an id number), and each id has a string of numbers associated with it (the strings are of finite length, typically 60-200). id is a…
gdg
  • 9
  • 3
0
votes
0 answers

How to calculate minimum distance in arraylist

I have a matrix, the distance in matrix is calculated using euclidean distance. After that, i have to search the minimum distance between object. But i have to keep the destination vertex as source vertex. I give the example. P1 P2 P3 …
0
votes
1 answer

How to read this graph input and put into an adjacency matrix?

I am confused and trying to figure out how to put this graph data into an adjacency matrix. This is some sample input from a text file: 0 1,28 3,33 1 2,10 4,44 2 3,50 3 4,30 4 This is how the matrix should look 0 1 2 3 4 0 INF 28 INF 33…
Brejuro
  • 3,421
  • 8
  • 34
  • 61
0
votes
1 answer

PageRank Calculation in Simplist Form - From Adjancy Matrix

I was asked to create an adjancy matrix from a table of: A B C A 0 1 0 B 1 0 1 C 0 0 0 I got this: A B C A 1/6 2/3 1/6 B 5/12 1/6 5/12 C 1/6 1/6 1/6 I am now being asked if I can sketch out in…
0
votes
2 answers

Create coordinate array from adjacency matrix - Matlab

I have a quick graph theory question. I have a 13 x 13 adjacency matrix in Matlab. I've already taken just the lower diagonal (this is an undirected graph) and subtracted off the identity matrix (so there aren't edges joining a node to itself). I…
DanMcK
  • 37
  • 9
0
votes
1 answer

Filtering an adjacency matrix in matlab

I have got a nx3 adjacency matrix that contains nodes in the first two dimension and the correspondant weight in the third dimension. I want to filter the matrix for specific thresholds (for nodes indexing). For example, I want to keep the adjacency…
snake plissken
  • 2,649
  • 10
  • 43
  • 64
0
votes
0 answers

Setting edge thickness in igraph's tkplot using a weighted network

Fairly straightforward, I'm working with a lot of network data represented as adjacency matrices. I've been using R's igraph package with some success and I'm just trying to figure out a way to set the width of the edges in the tkplot output to…
Sue Doh Nimh
  • 165
  • 2
  • 7
0
votes
1 answer

Calculating the degree matrix having the sparse representation of the adjacency matrix

I am trying to calculate the laplacian matrix of a graph. I ve calculated the sparse representation of the adjacency matrix which is stored in a text file with dimension Nx3. N the size of nodes (ith-node jth node weight). I open in Matlab this file…
snake plissken
  • 2,649
  • 10
  • 43
  • 64
0
votes
1 answer

Simple connected graph via adjacency matrix java

I am trying to make a program which decides if a graph is simple connected or not, using the adjacency matrix. I managed to make the code to tell me that all the nodes have a link to something, but that doesn't guarantee me that there is a way…
123123d
  • 195
  • 2
  • 14