Skip to content

Commit d56f74f

Browse files
committed
aligned graph_elements.md
1 parent 47d7f12 commit d56f74f

2 files changed

Lines changed: 19 additions & 71 deletions

File tree

docs/graph_elements.md

Lines changed: 19 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ By default, the `edge_descriptor` class does not carry any properties and assume
8787

8888
### Template parameters
8989

90-
- **`VertexType`**: The type of the vertex descriptors connected by this edge.
91-
- *Constraints*: must satisfy the **`type_traits::c_instantiation_of<vertex_descriptor>`** concept
9290
- **`DirectionalTag`**: A tag type indicating whether the edge is directed or undirected.
9391
- *Default value*: `directed_t`
9492
- *Constraints*: must satisfy the **`type_traits::c_edge_directional_tag`** concept (either `directed_t` or `undirected_t`)
@@ -99,15 +97,14 @@ By default, the `edge_descriptor` class does not carry any properties and assume
9997
### Member types
10098

10199
- **`type`**: Alias for the `edge_descriptor` itself.
102-
- **`vertex_type`**: Type of the vertex descriptors connected by this edge.
103100
- **`directional_tag`**: The tag indicating whether the edge is directed or undirected.
104101
- **`properties_type`**: Type of the edge properties as defined by the `Properties` template parameter.
105102

106103
### Constructors
107104

108-
- **`edge_descriptor(const vertex_type& first, const vertex_type& second)`**:
105+
- **`edge_descriptor(const types::id_type first, const types::id_type second)`**:
109106
- Constructs an edge between two vertices.
110-
- **`edge_descriptor(const vertex_type& first, const vertex_type& second, const properties_type& properties)`**:
107+
- **`edge_descriptor(const types::id_type first, const types::id_type second, const properties_type& properties)`**:
111108
- Constructs an edge between two vertices with specified properties.
112109
- *Constraints*: the `properties_type` must be non-default.
113110
- **Move constructor and assignment operator**: *default*
@@ -133,88 +130,48 @@ The destructor is *defaulted*, allowing proper cleanup of the `edge_descriptor`
133130
- **`incident_vertices() const`**:
134131
- *Description*: Returns a pair of references to the two vertices connected by the edge.
135132
- *Returned value*: $(u, v)$
136-
- *Return type*: `types::homogeneous_pair<const vertex_type&>`
137-
138-
- **`incident_vertex_ids() const`**:
139-
- *Description*: Returns the unique IDs of the vertices connected by the edge.
140-
- *Returned value*: $(u_{id}, v_{id})$
141-
- *Return type*: `types::homogeneous_pair<types::id_type>`
133+
- *Return type*: `types::homogeneous_pair<const types::id_type>`
142134

143135
- **`first() const`**:
144136
- *Description*: Returns a reference to the first vertex of the edge.
145137
- *Returned value*: $u$
146-
- *Return type*: `const vertex_type&`
138+
- *Return type*: `types::id_type`
147139

148140
- **`second() const`**:
149141
- *Description*: Returns a reference to the second vertex of the edge.
150142
- *Returned value*: $v$
151-
- *Return type*: `const vertex_type&`
143+
- *Return type*: `const types::id_type`
152144

153-
- **`incident_vertex(vertex) const`**:
145+
- **`incident_vertex(vertex_id) const`**:
154146
- *Description*: Returns the vertex on the other end of the edge relative to the provided vertex. Throws an error if the provided vertex is not incident with the edge.
155147
- *Returned value*:
156-
- $v$ if $\text{vertex} = u$
157-
- $u$ if $\text{vertex} = v$
148+
- $v$ if $\text{vertex-id} = u$
149+
- $u$ if $\text{vertex-id} = v$
158150
- error otherwise
159151
- *Parameters*:
160-
- `vertex: const vertex_type&` – the vertex for which the opposite vertex is requested.
161-
- *Return type*: `const vertex_type&`
162-
163-
- **`incident_vertex(vertex_id) const`**:
164-
- *Description*: Returns the vertex on the other end of the edge relative to the provided vertex ID. Throws an error if the provided vertex ID is invalid.
165-
- *Returned value*:
166-
- $v$ if $\text{vertex-id} = u_{id}$
167-
- $u$ if $\text{vertex-id} = v_{id}$
168-
- error otherwise
169-
- *Parameters*:
170-
- `vertex_id: const types::id_type` – the vertex ID for which the opposite vertex ID is requested.
171-
- *Return type*: `types::id_type`
172-
173-
- **`is_incident_with(vertex) const`**:
174-
- *Description*: Returns `true` if the provided vertex is connected to the edge.
175-
- *Returned value*: $\text{vertex} \in {u, v}$
176-
- *Parameters*:
177-
- `vertex: const vertex_type&` – the vertex to check for incidence with the edge.
178-
- *Return type*: `bool`
152+
- `vertex_id: const types::id_type` – the vertex for which the opposite vertex is requested.
153+
- *Return type*: `const types::id_type`
179154

180155
- **`is_incident_with(vertex_id) const`**:
181156
- *Description*: Returns `true` if a vertex with the given ID is connected to the edge.
182-
- *Returned value*: $\text{vertex-id} \in {u_{id}, v_{id}}$
157+
- *Returned value*: $\text{vertex-id} \in {u, v}$
183158
- *Parameters*:
184159
- `vertex_id: const types::id_type` – the vertex ID to check for incidence with the edge.
185160
- *Return type*: `bool`
186161

187-
- **`is_incident_from(vertex) const`**:
188-
- *Description*: Returns `true` if the provided vertex is the source of the edge (for directed edges).
189-
- *Returned value*:
190-
- For directed edges: $\text{vertex} = u$
191-
- For undirected edges: `is_incident_with(vertex)`
192-
- *Parameters*:
193-
- `vertex: const vertex_type&` – the vertex to check if it is the source.
194-
- *Return type*: `bool`
195-
196162
- **`is_incident_from(vertex_id) const`**:
197163
- *Description*: Returns `true` if a vertex with the given ID is the source of the edge.
198164
- *Returned value*:
199-
- For directed edges: $\text{vertex-id} = u_{id}$
200-
- For undirected edges: `is_incident_with(vertex)`
165+
- For directed edges: $\text{vertex-id} = u$
166+
- For undirected edges: `is_incident_with(vertex_id)`
201167
- *Parameters*:
202168
- `vertex_id: const types::id_type` – the vertex ID to check if it is the source.
203169
- *Return type*: `bool`
204170

205-
- **`is_incident_to(vertex) const`**:
206-
- *Description*: Returns `true` if the provided vertex is the target vertex of the edge (for directed edges).
207-
- *Returned value*:
208-
- For directed edges: $\text{vertex} = v$
209-
- For undirected edges: `is_incident_with(vertex)`
210-
- *Parameters*:
211-
- `vertex: const vertex_type&` – the vertex to check if it is the target.
212-
- *Return type*: `bool`
213-
214171
- **`is_incident_to(vertex_id) const`**:
215172
- *Description*: Returns `true` if a vertex with the given ID is the target of the edge.
216173
- *Returned value*:
217-
- For directed edges: $\text{vertex-id} = v_{id}$
174+
- For directed edges: $\text{vertex-id} = v$
218175
- For undirected edges: `is_incident_with(vertex)`
219176
- *Parameters*:
220177
- `vertex_id: const types::id_type` – the vertex ID to check if it is the target.
@@ -231,28 +188,23 @@ The destructor is *defaulted*, allowing proper cleanup of the `edge_descriptor`
231188

232189
```cpp
233190
template <
234-
type_traits::c_instantiation_of<vertex_descriptor> VertexType,
235191
type_traits::c_edge_directional_tag DirectionalTag = directed_t,
236192
type_traits::c_properties Properties = types::empty_properties>
237-
using edge = edge_descriptor<VertexType, DirectionalTag, Properties>;
193+
using edge = edge_descriptor<DirectionalTag, Properties>;
238194
```
239195

240196
- `directed_edge`: An alias for `edge_descriptor` specifically for directed edges.
241197

242198
```cpp
243-
template <
244-
type_traits::c_instantiation_of<vertex_descriptor> VertexType,
245-
type_traits::c_properties Properties = types::empty_properties>
246-
using directed_edge = edge_descriptor<VertexType, directed_t, Properties>;
199+
template <type_traits::c_properties Properties = types::empty_properties>
200+
using directed_edge = edge_descriptor<directed_t, Properties>;
247201
```
248202

249203
- `undirected_edge`: An alias for `edge_descriptor` specifically for undirected edges.
250204

251205
```cpp
252-
template <
253-
type_traits::c_instantiation_of<vertex_descriptor> VertexType,
254-
type_traits::c_properties Properties = types::empty_properties>
255-
using undirected_edge = edge_descriptor<VertexType, undirected_t, Properties>;
206+
template <type_traits::c_properties Properties = types::empty_properties>
207+
using undirected_edge = edge_descriptor<undirected_t, Properties>;
256208
```
257209

258210
<br />

include/gl/edge_descriptor.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ class edge_descriptor final {
1818
using type = edge_descriptor<DirectionalTag, Properties>;
1919
using directional_tag = DirectionalTag;
2020
using properties_type = Properties;
21-
using properties_ref_type = std::conditional_t<
22-
type_traits::is_default_properties_type_v<properties_type>,
23-
types::empty_properties,
24-
properties_type&>;
2521

2622
friend directional_tag;
2723

0 commit comments

Comments
 (0)