From 03c9ff0d0e9a68f77b02244d77680d22b2b1c2fd Mon Sep 17 00:00:00 2001 From: Abd Errahmane Kiouche <abd-errahmane.kiouche@etu.univ-lyon1.fr> Date: Fri, 15 Dec 2023 10:41:09 +0000 Subject: [PATCH] Upload New File --- (p,t)_sparsification/graph.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 (p,t)_sparsification/graph.h diff --git a/(p,t)_sparsification/graph.h b/(p,t)_sparsification/graph.h new file mode 100644 index 0000000..fc9c71f --- /dev/null +++ b/(p,t)_sparsification/graph.h @@ -0,0 +1,36 @@ +// +// Created by Kiouche on 1/20/2020. +// + +#ifndef P_K_COMPRESSION_GRAPH_H +#define P_K_COMPRESSION_GRAPH_H +#include <unordered_map> +#include <unordered_set> +#include <vector> + + + + + +namespace std{ + + typedef unordered_map<uint32_t,unordered_map<int,unordered_set<uint32_t >>> node_neighbors; /// key 1 = node_id , key 2 = depth , value = nodes + + typedef unordered_map<uint32_t , unordered_set<uint32_t >> graph; /// adjacency matrix , key = node_id + + typedef pair<uint32_t , uint32_t> edge; + + vector<edge> get_edges(graph &g,bool directed); + + + bool is_it_undirected(graph &g); + + + unordered_set<uint32_t > intersection(unordered_set<uint32_t> &s1,unordered_set<uint32_t> &s2); + + +} + + + +#endif //P_K_COMPRESSION_GRAPH_H -- GitLab