2024-09-26 14:32:20 +02:00
|
|
|
#ifndef GRAPH_H
|
|
|
|
#define GRAPH_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-10-04 13:05:02 +02:00
|
|
|
void random_adjacency(const uint64_t vertex_count,
|
|
|
|
uint64_t matrix[vertex_count][vertex_count]);
|
2024-09-26 14:32:20 +02:00
|
|
|
|
2024-10-04 17:36:40 +02:00
|
|
|
void calculate_distance_matrix(const uint64_t vertex_count,
|
|
|
|
const uint64_t adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
uint64_t distance_matrix[vertex_count][vertex_count]);
|
|
|
|
|
2024-10-09 01:42:55 +02:00
|
|
|
// returns 1 if it is a disconnected graph and just in case it was on purpose,
|
|
|
|
// all values in eccentricities will be set to UINT64_MAX
|
|
|
|
int get_eccentricities(const uint64_t vertex_count,
|
|
|
|
const uint64_t distance_matrix[vertex_count][vertex_count],
|
|
|
|
uint64_t eccentricities[vertex_count]);
|
|
|
|
|
2024-10-09 15:35:17 +02:00
|
|
|
// returns the radius or UINT64_MAX in case of a disconnected graph
|
2024-10-09 01:42:55 +02:00
|
|
|
uint64_t get_radius(const uint64_t vertex_count,
|
|
|
|
const uint64_t eccentricities[vertex_count]);
|
|
|
|
|
2024-10-09 15:35:17 +02:00
|
|
|
// returns the diameter or UINT64_MAX in case of a disconnected graph
|
2024-10-09 01:42:55 +02:00
|
|
|
uint64_t get_diameter(const uint64_t vertex_count,
|
|
|
|
const uint64_t eccentricities[vertex_count]);
|
|
|
|
|
2024-10-09 15:35:17 +02:00
|
|
|
// in case of a disconnected graph, all nodes will be inside centre
|
2024-10-09 01:42:55 +02:00
|
|
|
void get_centre(const uint64_t vertex_count,
|
|
|
|
const uint64_t eccentricities[vertex_count],
|
|
|
|
const uint64_t radius,
|
|
|
|
uint64_t centre[vertex_count]);
|
|
|
|
|
2024-10-09 15:35:17 +02:00
|
|
|
void calculate_path_matrix(const uint64_t vertex_count,
|
|
|
|
const uint64_t adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
uint64_t path_matrix[vertex_count][vertex_count]);
|
|
|
|
|
|
|
|
// please do not use this yet as the output is currently almost unreadable
|
|
|
|
void find_components_basic(const uint64_t vertex_count,
|
|
|
|
const uint64_t path_matrix[vertex_count][vertex_count],
|
|
|
|
uint64_t components[vertex_count][vertex_count]);
|
|
|
|
|
|
|
|
void find_bridges_basic(const uint64_t vertex_count,
|
|
|
|
const uint64_t adjacency_matrix[vertex_count][vertex_count],
|
|
|
|
const uint64_t components[vertex_count][vertex_count],
|
|
|
|
uint64_t bridges[vertex_count][2]);
|
|
|
|
|
2024-09-26 14:32:20 +02:00
|
|
|
#endif
|