2024-09-26 14:32:20 +02:00
|
|
|
#ifndef GRAPH_H
|
|
|
|
#define GRAPH_H
|
|
|
|
|
2024-10-22 23:38:00 +02:00
|
|
|
#include "matrix.h"
|
2024-09-26 14:32:20 +02:00
|
|
|
|
2024-10-22 23:26:09 +02:00
|
|
|
void random_adjacency(const ulong vertex_count,
|
|
|
|
ulong matrix[vertex_count][vertex_count]);
|
2024-09-26 14:32:20 +02:00
|
|
|
|
2024-10-22 23:38:00 +02:00
|
|
|
void random_adjacency_struct(const Matrix *matrix);
|
|
|
|
|
2024-10-22 23:26:09 +02:00
|
|
|
void calculate_distance_matrix(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
ulong distance_matrix[vertex_count][vertex_count]);
|
2024-10-04 17:36:40 +02:00
|
|
|
|
2024-10-11 00:09:26 +02:00
|
|
|
// returns 1 if it is a disconnected graph and sets all values in eccentricities to UINT64_MAX
|
2024-10-22 23:26:09 +02:00
|
|
|
int get_eccentricities(const ulong vertex_count,
|
|
|
|
const ulong distance_matrix[vertex_count][vertex_count],
|
|
|
|
ulong eccentricities[vertex_count]);
|
|
|
|
|
|
|
|
ulong get_radius(const ulong vertex_count,
|
|
|
|
const ulong eccentricities[vertex_count]);
|
|
|
|
|
|
|
|
ulong get_diameter(const ulong vertex_count,
|
|
|
|
const ulong eccentricities[vertex_count]);
|
|
|
|
|
|
|
|
void get_centre(const ulong vertex_count,
|
|
|
|
const ulong eccentricities[vertex_count],
|
|
|
|
const ulong radius,
|
|
|
|
ulong centre[vertex_count]);
|
|
|
|
|
|
|
|
void calculate_path_matrix(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
ulong path_matrix[vertex_count][vertex_count]);
|
|
|
|
|
|
|
|
void find_components_basic(const ulong vertex_count,
|
|
|
|
const ulong path_matrix[vertex_count][vertex_count],
|
|
|
|
ulong components[vertex_count][vertex_count]);
|
|
|
|
|
|
|
|
void find_components_dfs(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
ulong components[vertex_count][vertex_count]);
|
|
|
|
|
|
|
|
void find_bridges_basic(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong bridges[vertex_count][2]);
|
|
|
|
|
|
|
|
void find_bridges_dfs_v1(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong bridges[vertex_count][2]);
|
|
|
|
|
|
|
|
void find_bridges_dfs_v2(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong bridges[vertex_count][2]);
|
|
|
|
|
|
|
|
void find_articulations_basic(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong articulations[vertex_count]);
|
|
|
|
|
|
|
|
void find_articulations_dfs_v1(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong articulations[vertex_count]);
|
|
|
|
|
|
|
|
void find_articulations_dfs_v2(const ulong vertex_count,
|
|
|
|
const ulong adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const ulong components[vertex_count][vertex_count],
|
|
|
|
ulong articulations[vertex_count]);
|
2024-10-11 00:09:26 +02:00
|
|
|
|
2024-09-26 14:32:20 +02:00
|
|
|
#endif
|