Skip to content

Conversation

@mifrandir
Copy link
Contributor

@mifrandir mifrandir commented Jul 12, 2020

This is an alternative suggestion to #357 and trying to fix the issue #356.

What changes have been made?

  1. All occurrences, except for those that are explicitly alternatives, of "vertex"/"vertices", have been replaced with "node"/"nodes".
  2. Most occurrences of |V| and |E| now include "where V is the set of nodes and E is the set of edges".

Why do I think this is better than #357?

The letter V is very widely used to refer to the set of nodes/vertices, regardless of which word you prefer. I believe it is more important to stick to this convention to make the documentation more understandable to experienced readers as N is more commonly used to refer to a natural number.

This mismatch between symbols and words happens all the time and is nothing to worry about. (see electric current (I) in physics, for example)

I understand however that readers might be confused as to the meaning of V in particular. For this reason, I have included sufficient explanations within the documentation.

Fixes: #356

@glandium
Copy link

But then, all the types are e.g. Graph<N, E, ...>... not Graph<V, E, ...>.

@mifrandir
Copy link
Contributor Author

But the N in Graph<N, E, ...> does not refer to the set of nodes but to the node type, right? So, since they are two different things, they don't need to have the same symbol.

@XVilka
Copy link
Member

XVilka commented Jul 17, 2020

I think this approach is indeed better. Also explicit clarification of what V and N mean is helpful.

@ABorgna ABorgna modified the milestones: 0.6, 0.6.1 Jul 4, 2021
@RaoulLuque
Copy link
Member

@mifrandir If you would be fine with that, I would take over this PR and rebase it to the current branch and check for new spots where a change might be necessary :) @starovoid I am also tagging you to make sure, you are not already taking care of this?

@starovoid
Copy link
Collaborator

@starovoid I am also tagging you to make sure, you are not already taking care of this?

I plan to dive into this topic soon. We have two competing PRs (this and #357), and I plan to prefer the notation that @indietyp used in his branches next and bm/....

@RaoulLuque
Copy link
Member

I see, nice : ) What would be the difference between what is suggested here and what can be seen in the next branch? The generic parameters for the node and edge labels seem to have the same names and V and E is still used for node/vertex and edge sets respectively, right?

github-merge-queue bot pushed a commit that referenced this pull request Jun 4, 2025
This is a rebase of PR #358 with minor additions. Closes #356.

Thanks @mifrandir  for the work done!

---------

Co-authored-by: Franz Miltz <franz@miltz.me>
@github-actions github-actions bot mentioned this pull request Jun 4, 2025
@starovoid
Copy link
Collaborator

The changes were adopted in #814. Thanks!

@starovoid starovoid closed this Jun 4, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 6, 2025
## 🤖 New release

* `petgraph`: 0.8.1 -> 0.8.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.8.2](https://github.com/petgraph/petgraph/compare/petgraph@v0.8.1...petgraph@v0.8.2)
- 2025-06-06

### Bug Fixes

- Ford Fulkerson sometimes Panics on StableGraphs
([#793](#793))
- Run Maximal Cliques Quickcheck only on Digraphs which are symmetrical
([#800](#800))
- Run Steiner Tree Quickcheck on the connected components to properly
support disconnected graphs
([#801](#801))
- Quickcheck random01 function only outputs 0
([#798](#798))

### Documentation

- Specify that Acyclic::try_udpate_edge may add an edge
([#770](#770))
- Update remove_node doc comment in graphmap.rs
([#663](#663))
- Add examples to minimum spanning tree functions
([#808](#808))
- Minimal typo fix in comments
([#803](#803))
- Update docs.rs ([#807](#807))
- Add note about `StableGraph::edge_indices` behaviour
([#812](#812))
- Clarification of references to nodes and V (refresh #358)
([#814](#814))
- Fix link and mention Dfs and Bfs as special case in examples
([#816](#816))
- Unify algo docs
([#815](#815))

### New Features

- *(parser)* allow parsing graphs from Dot/Graphviz files
([#653](#653))
- Implement `DataMap` for `GraphMap` graphs
([#776](#776))
- Add Johnson's algorithm
([#741](#741))
- Add algorithm to find bridge edges
([#590](#590))

### Performance

- Reuse queue allocation in `maximum_matching` main loop
([#817](#817))

### Refactor

- Fix new clippy warnings
([#791](#791))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: starovoid <prototyperailgun@gmail.com>
RaoulLuque pushed a commit to RaoulLuque/petgraph that referenced this pull request Jun 18, 2025
… (petgraph#814)

This is a rebase of PR petgraph#358 with minor additions. Closes petgraph#356.

Thanks @mifrandir  for the work done!

---------

Co-authored-by: Franz Miltz <franz@miltz.me>
RaoulLuque pushed a commit to RaoulLuque/petgraph that referenced this pull request Jun 18, 2025
## 🤖 New release

* `petgraph`: 0.8.1 -> 0.8.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.8.2](https://github.com/petgraph/petgraph/compare/petgraph@v0.8.1...petgraph@v0.8.2)
- 2025-06-06

### Bug Fixes

- Ford Fulkerson sometimes Panics on StableGraphs
([petgraph#793](petgraph#793))
- Run Maximal Cliques Quickcheck only on Digraphs which are symmetrical
([petgraph#800](petgraph#800))
- Run Steiner Tree Quickcheck on the connected components to properly
support disconnected graphs
([petgraph#801](petgraph#801))
- Quickcheck random01 function only outputs 0
([petgraph#798](petgraph#798))

### Documentation

- Specify that Acyclic::try_udpate_edge may add an edge
([petgraph#770](petgraph#770))
- Update remove_node doc comment in graphmap.rs
([petgraph#663](petgraph#663))
- Add examples to minimum spanning tree functions
([petgraph#808](petgraph#808))
- Minimal typo fix in comments
([petgraph#803](petgraph#803))
- Update docs.rs ([petgraph#807](petgraph#807))
- Add note about `StableGraph::edge_indices` behaviour
([petgraph#812](petgraph#812))
- Clarification of references to nodes and V (refresh petgraph#358)
([petgraph#814](petgraph#814))
- Fix link and mention Dfs and Bfs as special case in examples
([petgraph#816](petgraph#816))
- Unify algo docs
([petgraph#815](petgraph#815))

### New Features

- *(parser)* allow parsing graphs from Dot/Graphviz files
([petgraph#653](petgraph#653))
- Implement `DataMap` for `GraphMap` graphs
([petgraph#776](petgraph#776))
- Add Johnson's algorithm
([petgraph#741](petgraph#741))
- Add algorithm to find bridge edges
([petgraph#590](petgraph#590))

### Performance

- Reuse queue allocation in `maximum_matching` main loop
([petgraph#817](petgraph#817))

### Refactor

- Fix new clippy warnings
([petgraph#791](petgraph#791))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: starovoid <prototyperailgun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation about space use of petgraph::graph::Graph is unclear

6 participants