Skip to content

Commit

Permalink
complexity discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
Coerulatus committed Apr 30, 2024
1 parent bde562e commit 369a152
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tutorials/graph2cell/cycle_lifting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this section we will instantiate the lifting we want to apply to the data. For this example the cycle lifting was chosen. The algorithm finds a cycle base for the graph and creates a cell for each cycle in said base. This is a connectivity based deterministic lifting that preserves the initial connectivity of the graph.\n",
"In this section we will instantiate the lifting we want to apply to the data. For this example the cycle lifting was chosen. The algorithm finds a cycle base for the graph and creates a cell for each cycle in said base. This is a connectivity based deterministic lifting that preserves the initial connectivity of the graph. [[1]](https://arxiv.org/abs/2309.01632) combine two heuristics to design an algorithm that selects cycle basis in $O(m \\log m)$ time, where $m$ is the number of edges of the graph.\n",
"\n",
"***\n",
"[[1]](https://arxiv.org/abs/2309.01632) Hoppe, J., & Schaub, M. T. (2024). Representing Edge Flows on Graphs via Sparse Cell\n",
"Complexes. In Learning on Graphs Conference (pp. 1-1). PMLR.\n",
"***\n",
"For cell complexes creating a lifting involves creating a `CellComplex` object from topomodelx and adding cells to it using the method `add_cells_from`. The `CellComplex` class then takes care of creating all the needed matrices.\n",
"\n",
"Similarly to before, we can specify the transformation we want to apply through its type and id --the correxponding config files located at `/configs/transforms`. \n",
Expand Down
7 changes: 6 additions & 1 deletion tutorials/graph2hypergraph/knn_lifting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this section we will instantiate the lifting we want to apply to the data. For this example the knn lifting was chosen. The algorithm takes the k nearest neighbors for each node and creates a hyperedge with them. The lifting is deterministic and creates a hypergraph with the same number of hyperedges as the number of nodes, and all the hyperedges have the same number of nodes in them. This lifting is based on the initial features of the nodes.\n",
"In this section we will instantiate the lifting we want to apply to the data. For this example the knn lifting was chosen. The algorithm takes the k nearest neighbors for each node and creates a hyperedge with them. The lifting is deterministic and creates a hypergraph with the same number of hyperedges as the number of nodes, and all the hyperedges have the same number of nodes in them. This lifting is based on the initial features of the nodes. The computational complexity of the algorithm is $O(nd+kn)$ [[1]](https://pubmed.ncbi.nlm.nih.gov/33211654/) where $n$ is the number of nodes in the graph, $d$ is the dimension of the feature space and $k$ is fixed.\n",
"\n",
"***\n",
"[[1]](https://pubmed.ncbi.nlm.nih.gov/33211654/) Gao, Y., Zhang, Z., Lin, H., Zhao, X., Du, S., & Zou, C. (2020). Hypergraph learning: Methods and\n",
"practices. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(5), 2548-2566.\n",
"***\n",
"\n",
"For hypergraphs creating a lifting involves creating the `incidence_hyperedges` matrix.\n",
"\n",
Expand Down
6 changes: 5 additions & 1 deletion tutorials/graph2simplicial/clique_lifting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this section we will instantiate the lifting we want to apply to the data. For this example the clique lifting was chosen. For a clique of n nodes the algorithm for $m=3,...,max(n, complex\\_dim)$ will create simplicials for every possible combinations containing m nodes of the clique. $complex\\_dim$ is a parameter of the lifting. This is a deterministic lifting, based on connectivity, that does not modify the initial connectivity of the graph.\n",
"In this section we will instantiate the lifting we want to apply to the data. For this example the clique lifting was chosen. For a clique of n nodes the algorithm for $m=3,...,max(n, complex\\_dim)$ will create simplicials for every possible combinations containing m nodes of the clique. $complex\\_dim$ is a parameter of the lifting. This is a deterministic lifting, based on connectivity, that does not modify the initial connectivity of the graph. The problem of extracting all the cliques in a graph is NP-hard, on in some formulaitons NP-complete (clique decision problem). The computational complexity of this algorithm is $O(n^k k^2)$[[1]](https://www.sciencedirect.com/science/article/pii/S0019995885800413), where $n$ is the number of nodes in the graph and $k$ is the highest clique dimension considered.\n",
"\n",
"***\n",
"[[1]](https://www.sciencedirect.com/science/article/pii/S0019995885800413) Cook, S. A. (1985). A taxonomy of problems with fast parallel algorithms. Information and control, 64(1-3), 2-22.\n",
"***\n",
"\n",
"For simplicial complexes creating a lifting involves creating a `SimplicialComplex` object from topomodelx and adding simplices to it using the method `add_simplices_from`. The `SimplicialComplex` class then takes care of creating all the needed matrices.\n",
"\n",
Expand Down

0 comments on commit 369a152

Please sign in to comment.