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

Average distance, Wiener Index, Szeged index #7314

Closed
nathanncohen mannequin opened this issue Oct 26, 2009 · 6 comments
Closed

Average distance, Wiener Index, Szeged index #7314

nathanncohen mannequin opened this issue Oct 26, 2009 · 6 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Oct 26, 2009

Hello !!

This patch defines :

  • The average distance between vertices : Graph.average_distance
  • The Szeged Index of a graph : Graph.szeged_index
  • The Wiener Index of a graph : Graph.wiener_index

Everything this patch adds (except the average distance) is documented in :
http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6TY9-3VVCHY8-9&_user=10&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=6d22be39b064af51023439c3bb59c459

This reference is mentioned in the docstrings.

Nathann

Component: graph theory

Author: Nathann Cohen

Reviewer: Robert Miller

Merged: sage-4.3.rc1

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

@nathanncohen nathanncohen mannequin added this to the sage-4.3.1 milestone Oct 26, 2009
@nathanncohen nathanncohen mannequin assigned rlmill Oct 26, 2009
@nathanncohen nathanncohen mannequin added the s: needs review label Oct 26, 2009
@mwhansen
Copy link
Contributor

comment:2

In the docstrings, you should not put comments on the sage: line like in

EXAMPLE:: 

    sage: # From [2], cited in [1] 
    sage: g=graphs.PathGraph(10) 
    sage: w=lambda x: (x*(x*x -1)/6) 
    sage: g.wiener_index()==w(10) 
    True 

Instead, it should be

EXAMPLE:

From [2], cited in [1]::

    sage: g=graphs.PathGraph(10) 
    sage: w=lambda x: (x*(x*x -1)/6) 
    sage: g.wiener_index()==w(10) 
    True 

Also, you should see the way that references are handled elsewhere in the Sage library.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Oct 26, 2009

comment:3

I hope you will prefer this one ! I had taken as examples other docstrings which you may find badly formatted... This time, I took as an example Minh's code from Cliques functiosn, knowing that never I witnessed Minh making the slightest error :-)

Nathann

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 15, 2009

Reviewer: Robert Miller

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 15, 2009

comment:4

Attachment: trac_7314.patch.gz

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 15, 2009

Author: Nathann Cohen

@mwhansen
Copy link
Contributor

Merged: sage-4.3.rc1

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

1 participant