Skip to content

Could the functions eccentricity() and radius() be implemented for weighted graphs? #893

@jskvor

Description

@jskvor

Could the functions eccentricity() and radius() be updated to support weighted graphs, similar to how distances() and diameter() do when passed the weights argument?

I know I can calculate eccentricity and radius for a weighted graph like this:

g <- sample_pa(1000, directed = FALSE)
E(g)$weight <- runif(ecount(g))
my_eccentricity <- apply(distances(g), 1, max)
my_radius <- min(my_eccentricity)

However, for consistency and usability, I think it would be better if eccentricity() and radius() accepted a weights argument like distances() and diameter().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions