GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This PR was created to discuss implementation details of the channel allocation module.
I've fixed Travis CI in development, please rebase/merge.
Created an initial file structure.
Initial models file.
Implemented the allocation task skeleton.
Implemented a meta algorithm skeleton.
Converts the graph datastructure into a NX graph and introduces some helper functions.
Initial implementation of a greedy coloring algorithm.
First working implementation.
Removed unnecessary parameter.
Debugged the first release.
Implemented a Django model to store data.
Relative import paths.
Added a TODO note explaining hard-coded arrays.
Added a ForeignKey to node's WifiInterface object.
highest_2ghz_channel no longer hard-coded.
Algorithm now works with multiple channel widths.
Initial testing framework with working fixtures.
Something does not look right, why are the commits duplicated?
hmm I must have messed up the merge. will try again.
Added the channel_allocation optional module.
Full path to fixtures file.
Cleaned up imports.
Added algorithm results for the tests.
@mitar The fixtures are not being loaded on the Travis image, but it works locally (without the full path). Can you take a look?
So we do not have optimal implementation of this? Even if it is NP hard? For small environments it could probably run all combinations, no?
No, this is our only algorithm for now. We could probably implement a thorough search as well.
Could you do it in the followup pull request please?
BTW, this still holds. ;-) You didn't answer. ;-)
Yep. But since we have 26 different start frequencies in the 5ghz band, this is 26^10 combinations for only 10 nodes. I was thinking of something like this:
generate a random allocation
if it's better than the best so far:
this is the current best
return current best.
What do you think?
This is not a search algorithm. :-) It looks like genetic algorithm, only that previous generation and next generation do not have anything in common. :-)
I think the best would be to use some general optimization tool and then express the problem in that language of the tool and then use one of their algorithms for optimization.
Is there a library which is already doing graph coloring?
There is NetworkX (similar to our current implementation), but I have found no libraries that do exact graph coloring.
This one has some algorithms: https://pypi.python.org/pypi/pyclustering
But yes, it really seems most are doing greedy.
Can you make this then be used in the other file as well? Instead of having a constant there?
Otherwise it looks pretty good. Just minor things. I do not know about the algorithm, though. I hope that it works. ;-)
Added a TODO explaining a hard-coded parameter.
Added a docstring for the channel_to_frequency helper.
Removed empty line.
Added a TODO to tweak the constant.
Fixed the style.
Created a specific helper for the queryset.
All other helpers in channel_lookup now depend on this helper.
Skipping a test if the app is not installed.
App no longer installed by default.
@mitar I made all the changes requested. One more code review :-) ?
Merge branch 'development' into channel-allocation
OK so let's merge it :-)
Great! Great job!!!