Skip to content

Upcoming change to igraph's girth() function affects this package #18

@szhorvat

Description

@szhorvat

Currently this packages checks if an igraph graph is a forest by computing it girth and comparing with 0:

https://github.com/mikldk/malan/blob/master/R/igraph.R#L26

 if (igraph::girth(x, circle = FALSE)$girth != 0L) stop("x must be a tree (or a forest)")

An upcoming version of igraph will change girth() to return Inf for graphs with no cycles (instead of the current 0). To keep compatibility with both the current and future versions, can you please compare both with Inf and 0?

This new version of igraph will also provide an is_forest() function, which will be slightly different than checking girth(): it will return FALSE for graphs with self-loops or multi-edges (which are ignores by girth()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions