Skip to content

Graph constructors are inconsistent in whether they create directed or undirected graphs #519

@szhorvat

Description

@szhorvat

Some graph constructors create directed graphs by default, some create undirected ones, even when they can create either. This is confusing. Can we make the default undirected for all graph constructors in 2.0, when this makes sense? Opinions?

Examples

  • These are all undirected by default, even though they can create directed graphs as well: sample_gnm, make_ring, make_chordal_ring, make_full_graph, make_bipartite_graph (!) ...
  • These are all directed by default, even though they can create undirected graphs as well: make_tree, make_star, make_graph (!, compare make_bipartite_graph), ...
  • Of course, there are cases when there is only one reasonable choice for the directedness. make_kautz must be directed, make_from_prufer must be undirected, make_line_graph must follow the directness of its argument, make_directed_graph and make_undirected_graph must follow their naming, etc.

Metadata

Metadata

Assignees

Labels

AI 🤖For issues that can be handled by a coding agent. A scheduled workflow will look at those.argument consistencyissues related to argument naming/defaultslifecycleDeprecating old APIs

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions