Skip to content
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

graph theory: degree sequence function #7564

Closed
sagetrac-mvngu mannequin opened this issue Nov 30, 2009 · 13 comments
Closed

graph theory: degree sequence function #7564

sagetrac-mvngu mannequin opened this issue Nov 30, 2009 · 13 comments

Comments

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Nov 30, 2009

The degree sequence of a graph is a basic property that is studied in an introductory course on graph theory. There should be examples explaining how to compute the degree sequence of a given graph.

Component: graph theory

Author: Minh Van Nguyen

Reviewer: Karl-Dieter Crisman, Nathann Cohen

Merged: sage-4.3.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/7564

@sagetrac-mvngu sagetrac-mvngu mannequin added this to the sage-4.3 milestone Nov 30, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin assigned rlmill Nov 30, 2009
@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Nov 30, 2009

comment:1

The patch trac_7564-degree-sequences.patch adds two examples to the method GenericGraph.degree(), showcasing how to obtain the degree sequence of a graph using that method.

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Nov 30, 2009

Author: Minh Van Nguyen

@kcrisman
Copy link
Member

comment:2

I will ask for more, if it isn't too much trouble. Could there be a small wrapper to (the better one) called degree_sequence as well? I realize this is very low priority. If the graph theory tour ever gets back up, this would be ideal to put in it as well.

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Nov 30, 2009

comment:3

Replying to @kcrisman:

Could there be a small wrapper to (the better one) called degree_sequence as well?

As I mentioned in my email to sage-devel, I'm unable to find a function or method in the graph theory module that computes the degree sequence of a given graph. So there is no function or method for wrapping, unless you can point me to such a method/function. On the other hand, are you suggesting that there be a method in the class GenericGraph called degree_sequence() that does exactly as its name implies? If so, then that could be done.

If the graph theory tour ever gets back up, this would be ideal to put in it as well.

Nod.

@kcrisman
Copy link
Member

comment:4

Replying to @sagetrac-mvngu:

Replying to @kcrisman:

Could there be a small wrapper to (the better one) called degree_sequence as well?

As I mentioned in my email to sage-devel, I'm unable to find a function or method in the graph theory module that computes the degree sequence of a given graph. So there is no function or method for wrapping, unless you can point me to such a method/function. On the other hand, are you suggesting that there be a method in the class GenericGraph called degree_sequence() that does exactly as its name implies? If so, then that could be done.

Yes, that is exactly what I meant - wrapping the examples you provide, as it were. I don't have time to do this, unfortunately, though it should be pretty easy.

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Dec 1, 2009

comment:5

The (new) patch trac_7564-degree-sequences.patch defines the method GenericGraph.degree_sequence() for computing the degree sequence of a graph.

@sagetrac-mvngu sagetrac-mvngu mannequin changed the title graph theory: examples on degree sequences graph theory: degree sequence function Dec 1, 2009
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 1, 2009

comment:6

Could it be possible to define in the same patch functions outdegree_sequence and indegree_sequence for DiGraphs ? :-)

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Dec 1, 2009

based on Sage 4.3.alpha0

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Dec 1, 2009

comment:7

Attachment: trac_7564-degree-sequences.patch.gz

Replying to @nathanncohen:

Could it be possible to define in the same patch functions outdegree_sequence and indegree_sequence for DiGraphs ? :-)

Y-E-S, yes! :-)

The patch trac_7564-degree-sequences.patch implements the following degree sequences:

  1. degree_sequence() --- the degree sequence of a (di)graph. This is implemented in the class GenericGraph.
  2. in_degree_sequence() --- the indegree sequence of a digraph. This is implemented in the class DiGraph.
  3. out_degree_sequence() --- the outdegree sequence of a digraph, also implemented in the class DiGraph.

I use the method names in_degree_sequence() and out_degree_sequence() to be consistent with how the graph theory module names the indegree and outdegree methods.

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 1, 2009

comment:8

Excellent ! Approved :-)

Thank you for contributing to the Graph Section !! :-)

@mwhansen
Copy link
Contributor

mwhansen commented Dec 1, 2009

Reviewer: Karl-Dieter Crisman, Nathann Cohen

@mwhansen
Copy link
Contributor

mwhansen commented Dec 1, 2009

Merged: sage-4.3.alpha1

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 1, 2009

comment:10

A patch written, reviewed and merged in 11 hours ? O_O

God O_O

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

No branches or pull requests

2 participants