New issue

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

Channel allocation module. #28

Merged
merged 44 commits into from Aug 24, 2016

Conversation

Projects
None yet
3 participants
@CdavM
Contributor

CdavM commented Aug 10, 2016

This PR was created to discuss implementation details of the channel allocation module.

@CdavM CdavM changed the title from Channel allocation to Channel allocation module. Aug 10, 2016

@kostko

This comment has been minimized.

Show comment
Hide comment
@kostko

kostko Aug 21, 2016

Member

I've fixed Travis CI in development, please rebase/merge.

Member

kostko commented Aug 21, 2016

I've fixed Travis CI in development, please rebase/merge.

@kostko

This comment has been minimized.

Show comment
Hide comment
@kostko

kostko Aug 21, 2016

Member

Something does not look right, why are the commits duplicated?

Member

kostko commented Aug 21, 2016

Something does not look right, why are the commits duplicated?

@CdavM

This comment has been minimized.

Show comment
Hide comment
@CdavM

CdavM Aug 21, 2016

Contributor

hmm I must have messed up the merge. will try again.

Contributor

CdavM commented Aug 21, 2016

hmm I must have messed up the merge. will try again.

@CdavM

This comment has been minimized.

Show comment
Hide comment
@CdavM

CdavM Aug 21, 2016

Contributor

@mitar The fixtures are not being loaded on the Travis image, but it works locally (without the full path). Can you take a look?

Contributor

CdavM commented Aug 21, 2016

@mitar The fixtures are not being loaded on the Travis image, but it works locally (without the full path). Can you take a look?

return sorted(nx_graph, key=nx_graph.degree, reverse=True)
def greedy_color_with_constraints(nx_graph, channels={}):

This comment has been minimized.

@mitar

mitar Aug 22, 2016

Member

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?

@mitar

mitar Aug 22, 2016

Member

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?

This comment has been minimized.

@CdavM

CdavM Aug 23, 2016

Contributor

No, this is our only algorithm for now. We could probably implement a thorough search as well.

@CdavM

CdavM Aug 23, 2016

Contributor

No, this is our only algorithm for now. We could probably implement a thorough search as well.

This comment has been minimized.

@mitar

mitar Aug 23, 2016

Member

Could you do it in the followup pull request please?

@mitar

mitar Aug 23, 2016

Member

Could you do it in the followup pull request please?

This comment has been minimized.

@mitar

mitar Aug 24, 2016

Member

BTW, this still holds. ;-) You didn't answer. ;-)

@mitar

mitar Aug 24, 2016

Member

BTW, this still holds. ;-) You didn't answer. ;-)

This comment has been minimized.

@CdavM

CdavM Aug 24, 2016

Contributor

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:
while()
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?

@CdavM

CdavM Aug 24, 2016

Contributor

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:
while()
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 comment has been minimized.

@mitar

mitar Aug 24, 2016

Member

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.

@mitar

mitar Aug 24, 2016

Member

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.

This comment has been minimized.

@mitar

mitar Aug 24, 2016

Member

Is there a library which is already doing graph coloring?

@mitar

mitar Aug 24, 2016

Member

Is there a library which is already doing graph coloring?

This comment has been minimized.

@CdavM

CdavM Aug 25, 2016

Contributor

There is NetworkX (similar to our current implementation), but I have found no libraries that do exact graph coloring.

@CdavM

CdavM Aug 25, 2016

Contributor

There is NetworkX (similar to our current implementation), but I have found no libraries that do exact graph coloring.

This comment has been minimized.

@mitar

mitar Aug 25, 2016

Member

This one has some algorithms: https://pypi.python.org/pypi/pyclustering

@mitar

mitar Aug 25, 2016

Member

This one has some algorithms: https://pypi.python.org/pypi/pyclustering

This comment has been minimized.

@mitar

mitar Aug 25, 2016

Member

But yes, it really seems most are doing greedy.

@mitar

mitar Aug 25, 2016

Member

But yes, it really seems most are doing greedy.

ch_2ghz = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
ch_5ghz = [36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 100, 102, 104, 106, 108, 110, 112, 114, 116,
118, 120, 122, 124, 126, 128, 132, 134, 136, 138, 140, 142, 144, 149, 151, 153, 155, 157, 159, 161, 165]
highest_2ghz_channel = max(ch_2ghz)

This comment has been minimized.

@mitar

mitar Aug 22, 2016

Member

Can you make this then be used in the other file as well? Instead of having a constant there?

@mitar

mitar Aug 22, 2016

Member

Can you make this then be used in the other file as well? Instead of having a constant there?

This comment has been minimized.

@CdavM

CdavM Aug 23, 2016

Contributor

Done

@CdavM

CdavM Aug 23, 2016

Contributor

Done

Show outdated Hide outdated nodewatcher/settings.py Outdated
@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Aug 22, 2016

Member

Otherwise it looks pretty good. Just minor things. I do not know about the algorithm, though. I hope that it works. ;-)

Member

mitar commented Aug 22, 2016

Otherwise it looks pretty good. Just minor things. I do not know about the algorithm, though. I hope that it works. ;-)

@CdavM

This comment has been minimized.

Show comment
Hide comment
@CdavM

CdavM Aug 23, 2016

Contributor

@mitar I made all the changes requested. One more code review :-) ?

Contributor

CdavM commented Aug 23, 2016

@mitar I made all the changes requested. One more code review :-) ?

@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Aug 23, 2016

Member

LGTM.

Member

mitar commented Aug 23, 2016

LGTM.

@CdavM

This comment has been minimized.

Show comment
Hide comment
@CdavM

CdavM Aug 24, 2016

Contributor

OK so let's merge it :-)

Contributor

CdavM commented Aug 24, 2016

OK so let's merge it :-)

@mitar mitar merged commit 06f2ec0 into development Aug 24, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mitar mitar deleted the channel-allocation branch Aug 24, 2016

@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Aug 24, 2016

Member

Great! Great job!!!

Member

mitar commented Aug 24, 2016

Great! Great job!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment