STEINGEN/include/random_graph.h

26 lines
615 B
C
Raw Permalink Normal View History

2024-11-25 12:10:39 +01:00
#ifndef RANDOM_GRAPH_H
#define RANDOM_GRAPH_H
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include "rand_large.h"
2024-11-25 12:10:39 +01:00
// Edge structure
typedef struct Edge {
uint32_t src;
uint32_t dest;
2024-11-25 12:10:39 +01:00
} Edge;
// Function prototypes
2024-12-24 16:23:07 +01:00
int cmpInt(const void *a, const void *b);
uint64_t uv2index(uint32_t u, uint32_t v, uint32_t n);
uint32_t min(uint32_t u, uint32_t v);
uint32_t max(uint32_t u, uint32_t v);
int8_t index2uv(uint64_t index, uint32_t n, uint32_t *u, uint32_t *v);
void random_connected_graph(
uint32_t n, uint64_t m, Edge *edges, uint16_t* seed);
2024-11-25 12:10:39 +01:00
#endif // RANDOM_GRAPH_H