graphprogram/graph.c

19 lines
574 B
C
Raw Normal View History

2024-09-26 14:32:20 +02:00
#include <stdint.h>
#include <time.h>
#include <stdlib.h>
void random_adjacency(const uint64_t row_length, const uint64_t column_length, uint64_t matrix[row_length][column_length]) {
2024-10-04 01:03:39 +02:00
2024-09-26 14:32:20 +02:00
srand(time(NULL));
for (uint8_t row_index=0; row_index < row_length; row_index++) {
for (uint8_t column_index=0; column_index < column_length; column_index++) {
if(column_index == row_index) {
2024-10-04 01:03:39 +02:00
matrix[row_index][column_index] = 0;
2024-09-26 14:32:20 +02:00
continue;
}
matrix[row_index][column_index] = rand()%2;
}
}
}