adjacenssimatriisin
An adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices in the graph are adjacent or not. For a graph with n vertices, the adjacency matrix is an n x n matrix A, where A is defined as:
A[i][j] = 1 if there is an edge between vertex i and vertex j, and 0 otherwise.
In simple undirected graphs, the adjacency matrix is symmetric, meaning A[i][j] = A[j][i]. If the graph has
The number of edges in an undirected graph is half the sum of all elements in its