diff --git a/d0/d58/classgraph_1_1_rooted_tree.html b/d0/d58/classgraph_1_1_rooted_tree.html index 0dbbe3f4d..5796a9a0a 100644 --- a/d0/d58/classgraph_1_1_rooted_tree.html +++ b/d0/d58/classgraph_1_1_rooted_tree.html @@ -139,10 +139,10 @@ int  Index of the root vertex.
  - Public Attributes inherited from
graph::Graph - -std::vector< std::vector< int > > neighbors - for each vertex it stores a list indicies of its neighbors
-  + +std::vector< std::vector< int > > neighbors + for each vertex it stores a list indicies of its neighbors
+  @@ -195,9 +195,9 @@ Protected Member Functions

Protected Member Functions

-
94  : Graph(undirected_edges.size() + 1, undirected_edges), root(root_) {
-
95  populate_parents();
-
96  }
+
95  : Graph(undirected_edges.size() + 1, undirected_edges), root(root_) {
+ +
97  }
@@ -227,28 +227,28 @@ Protected Member Functions

Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm starting from the root vertex searching the entire tree and labeling parents for all vertices.

Returns
none
-
116  {
-
117  // Initialize the vector with -1 which indicates the vertex
-
118  // wasn't yet visited.
-
119  parent = std::vector<int>(number_of_vertices(), -1);
-
120  level = std::vector<int>(number_of_vertices());
-
121  parent[root] = root;
-
122  level[root] = 0;
-
123  std::queue<int> queue_of_vertices;
-
124  queue_of_vertices.push(root);
-
125  while (!queue_of_vertices.empty()) {
-
126  int vertex = queue_of_vertices.front();
-
127  queue_of_vertices.pop();
-
128  for (int neighbor : neighbors[vertex]) {
-
129  // As long as the vertex was not yet visited.
-
130  if (parent[neighbor] == -1) {
-
131  parent[neighbor] = vertex;
-
132  level[neighbor] = level[vertex] + 1;
-
133  queue_of_vertices.push(neighbor);
-
134  }
-
135  }
-
136  }
-
137  }
+
117  {
+
118  // Initialize the vector with -1 which indicates the vertex
+
119  // wasn't yet visited.
+ + +
122  parent[root] = root;
+
123  level[root] = 0;
+
124  std::queue<int> queue_of_vertices;
+
125  queue_of_vertices.push(root);
+
126  while (!queue_of_vertices.empty()) {
+
127  int vertex = queue_of_vertices.front();
+
128  queue_of_vertices.pop();
+
129  for (int neighbor : neighbors[vertex]) {
+
130  // As long as the vertex was not yet visited.
+
131  if (parent[neighbor] == -1) {
+
132  parent[neighbor] = vertex;
+
133  level[neighbor] = level[vertex] + 1;
+
134  queue_of_vertices.push(neighbor);
+
135  }
+
136  }
+
137  }
+
138  }
Here is the call graph for this function:
@@ -263,20 +263,20 @@ Here is the call graph for this function:
-
graph::Graph::Graph
Graph(size_t N, const std::vector< std::pair< int, int > > &undirected_edges)
Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid v...
Definition: lowest_common_ancestor.cpp:61
-
graph::RootedTree::level
std::vector< int > level
Stores the distance from the root.
Definition: lowest_common_ancestor.cpp:105
+
graph::Graph::Graph
Graph(size_t N, const std::vector< std::pair< int, int > > &undirected_edges)
Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid v...
Definition: lowest_common_ancestor.cpp:62
+
graph::RootedTree::level
std::vector< int > level
Stores the distance from the root.
Definition: lowest_common_ancestor.cpp:106
std::vector< int >
std::vector::size
T size(T... args)
-
graph::RootedTree::populate_parents
void populate_parents()
Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm...
Definition: lowest_common_ancestor.cpp:116
+
graph::RootedTree::populate_parents
void populate_parents()
Calculate the parents for all the vertices in the tree. Implements the breadth first search algorithm...
Definition: lowest_common_ancestor.cpp:117
std::queue
STL class.
std::queue::front
T front(T... args)
-
graph::RootedTree::parent
std::vector< int > parent
Stores parent of every vertex and for root its own index. The root is technically not its own parent,...
Definition: lowest_common_ancestor.cpp:103
-
graph::Graph::neighbors
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:78
+
graph::RootedTree::parent
std::vector< int > parent
Stores parent of every vertex and for root its own index. The root is technically not its own parent,...
Definition: lowest_common_ancestor.cpp:104
std::queue::pop
T pop(T... args)
-
graph::Graph::number_of_vertices
int number_of_vertices() const
Definition: lowest_common_ancestor.cpp:73
+
graph::Graph::neighbors
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:77
+
graph::Graph::number_of_vertices
int number_of_vertices() const
Definition: lowest_common_ancestor.cpp:74
std::queue::empty
T empty(T... args)
std::queue::push
T push(T... args)
-
graph::RootedTree::root
int root
Index of the root vertex.
Definition: lowest_common_ancestor.cpp:107
+
graph::RootedTree::root
int root
Index of the root vertex.
Definition: lowest_common_ancestor.cpp:108
diff --git a/da/d9a/class_graph.html b/da/d9a/class_graph.html index 55f82b6c4..9dad9a0da 100644 --- a/da/d9a/class_graph.html +++ b/da/d9a/class_graph.html @@ -194,12 +194,12 @@ unsigned int m_vertices AdjList m_adjList   - + std::vector< std::vector< int > > residual_capacity -  - +  + std::vector< std::vector< int > > capacity -  +  int total_nodes = 0   diff --git a/da/d9a/class_graph.js b/da/d9a/class_graph.js index 2d00f0209..813b01082 100644 --- a/da/d9a/class_graph.js +++ b/da/d9a/class_graph.js @@ -25,7 +25,7 @@ var class_graph = [ "operator=", "da/d9a/class_graph.html#ac3e58f4a0c8c65befe6629f4e1b71142", null ], [ "print_flow_info", "da/d9a/class_graph.html#ac93ec6a876da0b5a61ebf3bebc347ba5", null ], [ "set_graph", "da/d9a/class_graph.html#a6d95f41d2df61697379ccc209c78f801", null ], - [ "capacity", "da/d9a/class_graph.html#ac5ec03f21ae7eeb64fd9d63a141f5b2d", null ], + [ "capacity", "da/d9a/class_graph.html#a8a34b80e2f3749992e0e9b83de742fba", null ], [ "edge_participated", "da/d9a/class_graph.html#a73268574e2528b8e760191113ef6d1eb", null ], [ "edgeNum", "da/d9a/class_graph.html#a10ff9c6c323cf435f18e424dbb62235e", null ], [ "edges", "da/d9a/class_graph.html#a3535be2ce0d62152e54395951330da81", null ], @@ -34,7 +34,7 @@ var class_graph = [ "m_vertices", "da/d9a/class_graph.html#a61943646676002a5e75f7b6493c25713", null ], [ "max_flow", "da/d9a/class_graph.html#aa0aaff1a0c13bdf209ea40b83ac01ae6", null ], [ "parent", "da/d9a/class_graph.html#a9474bfdf769cc0d23f5b16c181a29431", null ], - [ "residual_capacity", "da/d9a/class_graph.html#a387897a2f5c28209bbda67db64a8992f", null ], + [ "residual_capacity", "da/d9a/class_graph.html#a92a601c0ada840011e2719cb753b490b", null ], [ "sink", "da/d9a/class_graph.html#a47336f7cfe4698ef887a34e03f1a3856", null ], [ "source", "da/d9a/class_graph.html#a9912e31b32405d21a4c22a9ab8dece30", null ], [ "total_edges", "da/d9a/class_graph.html#ad621c5393837c21780ff3477431707ac", null ], diff --git a/db/d1e/classgraph_1_1_graph-members.html b/db/d1e/classgraph_1_1_graph-members.html index 18456009f..7b05ca54e 100644 --- a/db/d1e/classgraph_1_1_graph-members.html +++ b/db/d1e/classgraph_1_1_graph-members.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('dc/d61/classgraph_1_1_graph.html','../

This is the complete list of members for graph::Graph, including all inherited members.

- +
Graph(size_t N, const std::vector< std::pair< int, int > > &undirected_edges)graph::Graphinline
neighborsgraph::Graph
neighborsgraph::Graph
number_of_vertices() constgraph::Graphinline
diff --git a/db/d8e/lowest__common__ancestor_8cpp__incl.map b/db/d8e/lowest__common__ancestor_8cpp__incl.map index c8bb3606e..0536dd78d 100644 --- a/db/d8e/lowest__common__ancestor_8cpp__incl.map +++ b/db/d8e/lowest__common__ancestor_8cpp__incl.map @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/db/d8e/lowest__common__ancestor_8cpp__incl.md5 b/db/d8e/lowest__common__ancestor_8cpp__incl.md5 index ec41b16f6..e9c98b09d 100644 --- a/db/d8e/lowest__common__ancestor_8cpp__incl.md5 +++ b/db/d8e/lowest__common__ancestor_8cpp__incl.md5 @@ -1 +1 @@ -feebcb6a27d1da6fc5957bddbf9dee90 \ No newline at end of file +da9501f775cb6385de39dd889873c654 \ No newline at end of file diff --git a/db/d8e/lowest__common__ancestor_8cpp__incl.svg b/db/d8e/lowest__common__ancestor_8cpp__incl.svg index e7b2200c9..a2f9cb41c 100644 --- a/db/d8e/lowest__common__ancestor_8cpp__incl.svg +++ b/db/d8e/lowest__common__ancestor_8cpp__incl.svg @@ -4,18 +4,18 @@ - + graph/lowest_common_ancestor.cpp - + Node1 - -graph/lowest_common -_ancestor.cpp + +graph/lowest_common +_ancestor.cpp @@ -23,76 +23,76 @@ Node2 - -iostream + +cassert Node1->Node2 - - + + Node3 - -utility + +iostream Node1->Node3 - - + + Node4 - -vector + +queue Node1->Node4 - - + + Node5 - -queue + +utility Node1->Node5 - - + + Node6 - -cassert + +vector Node1->Node6 - - + + diff --git a/dc/d61/classgraph_1_1_graph.html b/dc/d61/classgraph_1_1_graph.html index 1d8414dbb..9ded09e62 100644 --- a/dc/d61/classgraph_1_1_graph.html +++ b/dc/d61/classgraph_1_1_graph.html @@ -121,10 +121,10 @@ Public Member Functions - - - + + +

Public Attributes

-std::vector< std::vector< int > > neighbors
 for each vertex it stores a list indicies of its neighbors
 
+std::vector< std::vector< int > > neighbors
 for each vertex it stores a list indicies of its neighbors
 

Detailed Description

Class for representing a graph as an adjacency list. Its vertices are indexed 0, 1, ..., N - 1.

@@ -171,13 +171,13 @@ Public Attributes -
61  {
-
62  neighbors.resize(N);
-
63  for (auto &edge : undirected_edges) {
-
64  neighbors[edge.first].push_back(edge.second);
-
65  neighbors[edge.second].push_back(edge.first);
-
66  }
-
67  }
+
62  {
+
63  neighbors.resize(N);
+
64  for (auto &edge : undirected_edges) {
+
65  neighbors[edge.first].push_back(edge.second);
+
66  neighbors[edge.second].push_back(edge.first);
+
67  }
+
68  }
Here is the call graph for this function:
@@ -211,9 +211,7 @@ Here is the call graph for this function:

Function to get the number of vertices in the graph

Returns
the number of vertices in the graph.
-
73  {
-
74  return neighbors.size();
-
75  }
+
74 { return neighbors.size(); }
Here is the call graph for this function:
@@ -231,7 +229,7 @@ Here is the call graph for this function:
T resize(T... args)
T size(T... args)
T push_back(T... args)
-
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:78
+
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Definition: lowest_common_ancestor.cpp:77