FAQ Database Discussion Community

## Sorting rows and columns of adjacency matrix to reveal cliques

algorithm,matlab,adjacency-matrix,clique-problem
I'm looking for a reordering technique to group connected components of an adjacency matrix together. For example, I've made an illustration with two groups, blue and green. Initially the '1's entries are distributed across the rows and columns of the matrix. By reordering the rows and columns, all '1''s can...

## Counting nodes in the largest cycle of an adjacency matrix

c++,function,recursion,adjacency-matrix,undirected-graph
I am currently writing a program using an undirected graph. Im representing this by creating an adjacency matrix of the connections. if(adjacency_matrix[i][j] == 1){ //i and j have and edge between them } else{ //i and j are not connected } What I am attempting to do is to find...

## Can you help me figuring out, what this Snipped of Java-code is supposed to do?

java,matrix,adjacency-matrix
I found this Java code in a job interview question and tried to figure it out. (I am a Smalltalker and am less familar with the syntax of Java as maybe I thought). As far as I can see, it spawns a thread for every row in a data matrix....

## Matlab: adjacency matrix from patch object

matlab,graph,3d,adjacency-matrix
I have a Matlab patch object, in which the Faces property is a list of vertex index triplets, so each row represents one triangular face. For example: 293 13 1 433 13 293 293 294 433 434 433 294 In this case, the first row defines a face stretched between...

## Find adjacency matrix given a list of class labels

matlab,adjacency-matrix
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...

## C - Segmentation fault when adding edge to graph

c,graph,segmentation-fault,edge,adjacency-matrix
I have to use an undirected weighted graph (adjacency matrix) for this program. typedef struct graph { int n; /* Number of vertices */ Boolean *visited; /* Will be later used */ double **mat; /* It has to be a double */ } Graph; Function used to initialize the graph:...

## scala: adjacency matrix graphs

arrays,scala,graph,adjacency-matrix
I am trying to understand how to build graphs in Scala, till now I have this: import scala.collection.mutable.ArrayBuffer object TestGraph { class Graph(vertices: Array[String], edges: ArrayBuffer[(Int, Int)]) { def size: Int = vertices.length def vertex(index: Int): String = vertices(index) def index(vertex: String): Int = vertices.indexOf(vertex) def printEdges(): Unit = {...

## How do I complete this BiPartite Matching program?

java,algorithm,recursion,adjacency-matrix,bipartite
I'm working on an assignment for class where I have to read an adjacency matrix and output the bipartite matches in Java. I've been given two methods to fill out to accomplish this, and I've managed to get it working for one use case, but I'm having some trouble making...

## adjacency matrix find if neighbores

c,matrix,adjacency-matrix
I have some homewrok that looks like this: Question 1 ( First program adjacency.c file ) Directed tree structure T has N nodes represented by the adjacency matrix A size NxN as follows: A [ u ] [ v] == TRUE if and only if there is a directed arc...

## “too many arguments for format” warning

c,matrix,adjacency-matrix
#include <stdio.h> #define N 11 enum {FALSE, TRUE}; typedef int adj_mat[N][N]; int path2(adj_mat A, int u, int v, int temp) { if(u == temp && A[u][v] == TRUE) return TRUE; if(A[u][v] == FALSE) return path2(A, u-1, v, temp); if(A[u][v] == TRUE) return path2(A, N, u, temp); return FALSE; } int...