Skip to content

Commit

Permalink
added comments and formatted code according to clang-format style Google
Browse files Browse the repository at this point in the history
  • Loading branch information
Satvik Racharla committed Nov 4, 2023
1 parent 6f62549 commit 7c41e14
Show file tree
Hide file tree
Showing 3 changed files with 1,943 additions and 1,842 deletions.
27 changes: 13 additions & 14 deletions include/graaflib/algorithm/graph_isomorphism.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#pragma once

#include <algorithm>
#include <graaflib/types.h>
#include <graaflib/graph.h>
#include <vector>
#include <unordered_map>
#include <graaflib/types.h>

#include <algorithm>
#include <optional>
#include <unordered_map>
#include <unordered_set>
#include <vector>

namespace graaf::algorithm {

Expand All @@ -16,22 +17,20 @@ namespace graaf::algorithm {
* This function checks whether two given graphs are isomorphic, meaning
* they are structurally identical up to vertex and edge relabeling.
* If the graphs are isomorphic, the function returns an optional containing
* a mapping from the vertices of the first graph to the vertices of the second graph.
* If the graphs are not isomorphic, the function returns std::nullopt.
* a mapping from the vertices of the first graph to the vertices of the second
* graph. If the graphs are not isomorphic, the function returns std::nullopt.
*
* @tparam V The vertex type of the graphs.
* @tparam E The edge type of the graphs.
* @tparam T The graph type of the graphs (directed or undirected).
* @param lhs The first graph to compare.
* @param rhs The second graph to compare.
* @return An optional containing a mapping from the vertices of lhs to those of rhs if isomorphic; otherwise std::nullopt.
* @return An optional containing a mapping from the vertices of lhs to those of
* rhs if isomorphic; otherwise std::nullopt.
*/

template <typename V, typename E, graph_type T>
std::optional<std::unordered_map<vertex_id_t, vertex_id_t>>
check_isomorphism(
const graph <V, E, T> & lhs,
const graph <V, E, T> & rhs
);
} // namespace graaf::algorithm
std::optional<std::unordered_map<vertex_id_t, vertex_id_t>> check_isomorphism(
const graph<V, E, T>& lhs, const graph<V, E, T>& rhs);
} // namespace graaf::algorithm
#include "graph_isomorphism.tpp"
Loading

0 comments on commit 7c41e14

Please sign in to comment.