#17582: Bandwidth of a graph
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-6.5
enhancement | Resolution:
Priority: major | Merged in:
Component: graph | Reviewers:
theory | Work issues:
Keywords: | Commit:
Authors: | 49eac6fa5956bd46be27182b5eae887d9632e450
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
public/17582 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by ncohen):
Hello !
> The {{{bandwidth_C}}} method is quite hard to understand. Could you add
some more intuition on its principle?
I added some technical comments in the code, but I do not know how to
provide more 'intuition'. Have you looked at the module's documentation ?
Did you find it clear, or is there something that I did not explain
sufficiently ?
> It could be useful also for you if you want to modify it in the future
and don't remember exactly what you did ;)
Don't worry about that. I rewrite the same piece of code, over and over,
in different patches to never forget it. You will find it at the bottom of
#17582, or in the SubgraphSearch routine. And probably in others too, but
I forgot where `^^;`
> In this command:
> {{{pi = (n-1-i//2) if (i%2) else (i//2) # 0, n-1,1,n-2,2,n-3,3, ...
that's an ugly 'if'}}}
> Shouldn't you use {{{((n-1-i)//2)}}} ?
No, I think that it is correct. As i<n we would have that (n-1-i)//2<n/2
and also that i//2<n/2, so that pi<n/2 in general. And pi should be a
permutation: 0, n-1,1,n-1,2, ...
Tell me if it is easier to understand with the new code comments.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/17582#comment:13>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.