AnswerBun.com

Hypercube traversal algorithm

Mathematics Asked on January 1, 2022

A recursive algorithm that I’m working on is based on traversing an $n$-dimensional hypercube. The quantity associated to each vertex can be computed by combining the values of all the adjacent vertices of lower weight (weight = number of 1s in the coordinate vector). The goal is to reach the vertex of highest weight (11…1) starting from the vertex of lowest weight (00…0).

In order to optimize the algorithm, I want to minimize space and time requirements. Time is the number of steps to reach the final vertex, and space is the largest number of values that need to be kept in memory at any moment.

Version 1: Compute all the $binom{n}{k}$ vertices of weight $k$, drop the vertices of weight $k-1$ and proceed with the vertices of weight $k+1$. This requires at most about $binom{n}{n/2}approx 2^n/sqrt{n}$ space and $sum_k kbinom{n}{k} = n2^{n-1}$ time.

Version 2: Compute all the vertices that are needed to "count" up from 00…0 to 11…1 while restarting for each value (i.e. dropping all intermediate values). This needs $O(n^2)$ space and $O(n!)$ time.

Is there a way of traversing the graph that combines the best of both the ideas above? i.e. $O(n^2)$ space and $O(n2^n)$ time?

Add your own answers!

Related Questions

Fundamental group of Klein Bottle

2  Asked on December 15, 2021 by jos-luis-camarillo-nava

         

Lottery – Probability Discrepancy

2  Asked on December 15, 2021 by cannon444

         

Find locus of point

0  Asked on December 15, 2021

     

about the Laguerre square expansion Sin(x)

0  Asked on December 13, 2021 by charlessilva

   

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir