#13073: recognition of weakly chordal graphs
--------------------------------------------------+-------------------------
Reporter: eisermbi | Owner: jason,
ncohen, rlm
Type: enhancement | Status:
needs_review
Priority: major | Milestone: sage-5.1
Component: graph theory | Resolution:
Keywords: weakly chordal, hole, antihole | Work issues:
Report Upstream: N/A | Reviewers: Nathann
Cohen
Authors: Birk Eisermann | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------+-------------------------
Comment (by eisermbi):
Hello Nathann !!
I incorporated your suggestion. The _has_edge is moved and changed.
> > Finally some what- and why-questions:
> > - What is the difference between '`del InPath[c]`' and
'`InPath.pop(c)`' ? You changed the former to the latter but only in some
places...
>
> Hmmmm... I believed that that the following code would also destroy the
content of ``a``, though it still exists.
>
> {{{
> sage: a = set([1,2,3])
> sage: a
> set([1, 2, 3])
> sage: d = {8:a}
> sage: d
> {8: set([1, 2, 3])}
> sage: del d[8]
> sage: a
> set([1, 2, 3])
> }}}
>
> I believed that a call to "del" was a direct order to destroy the given
object, but it only removes the value from the dictionary. Looks good :
sorry for this (partial!) modification, please update the code however you
like `:-)`
Okay, since I am new to python I did not know about this pop method
before. I did some more research and found they are the same expect that
the pop-method returns the value while del does not. As a post on
stackoverflow shows (and I also check myself) this difference has impact
on the run time. So if the value of the removed element is not needed
'del' is a bit faster. Hence, I go for 'del'...
>
> > - I find the change
> > `for u in g.vertices()`
> > to
> > `for u in g`
> > makes the code harder to read for an outsider. Why making it more
cryptic?
>
> `O_o`
>
> Well, there is a small difference between the two lines, but I only
changed it to make the code more... readable. You think "for u in g" is
worse that "for u in g.vertices()" ?
>
> We can write `\forall u \in G` in papers, and I usually write "for u in
g" because the line is shorter, and (to me) easier to read.
Well, then let us write "for e in g" to iterate over all edges, alright?
(joke). I am used to "for u in V(G)" or if we have G=(V,E) then "for u in
V", and similar "for e in E(G)", "for e in E".
> The difference between the two lines is that g.vertices() returns the
*sorted* list of vertices, while "for i in g" returns the list of vertices
in any order -- hence there is no call to *sort* and is *theoretically*
faster, though I do not think that there is any significant difference in
practice. It's up to you too if you don't like it !
Okay, we can use 'g' to avoid "sort" and since the comment makes it clear
that u is a vertex. But I am not so convinced that it is well readable for
everyone.
>
> > - Why is the reference deleted in is_longanti_hole_free (but not in
is_long_hole_free)?
>
> Oh. I believe Sage complained when I built the documentation (``sage
-docbuild reference html``) because of the double entry (with the same
reference code). The link works when you click on them in the HTML
documentation though.
I see. There was no error but warnings about duplicate entries, hence
removed.
>
> > - There is an upwards shift arrow appended at the end of the line
> > # C[i]...C[j] is necessarily an induced cycle.⇧
> > in process() of is_long_hole_free(). Similar for
is_long_antihole_free(). What is the use of that symbol?
>
> It expresses my right to make typos in patches, but I understand from
your comment that you believe I do not deserve that right `:-P`
I was just curious. And for a 'master of sage', sure, no typos allowed...
;-)
Thanks for all of your suggestions! :-)
Birk
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13073#comment:15>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.