Skip to content

Commit a35a539

Browse files
committed
Edit README
1 parent d7ec5d0 commit a35a539

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ graph.removeEdge(from: node1.id, to: node2.id)
9696
`Graph` offers many ways to query its nodes, node IDs, values and edges. Have a look into [Graph.swift](https://github.com/codeface-io/SwiftNodes/blob/master/Code/Graph/Graph.swift) to see them all. In addition, `GraphNode` has caches that enable quick access to its neighbours:
9797

9898
```swift
99-
node.descendants // all nodes to which there is an edge from node
100-
node.ancestors // all nodes from which there is an edge to node
101-
node.neighbours // all descendants and ancestors
102-
node.isSink // whether node has no descendants
103-
node.isSource // whether node has no ancestors
99+
node.descendants // all nodes to which there is an edge from node
100+
node.ancestors // all nodes from which there is an edge to node
101+
node.neighbours // all descendants and ancestors
102+
node.isSink // whether node has no descendants
103+
node.isSource // whether node has no ancestors
104104
```
105105

106106
### Sort Nodes
@@ -116,7 +116,7 @@ graph.sort { $0.id < $1.id } // graph.values == [3, 5]
116116

117117
### Copy a Graph
118118

119-
Many algorithms produce a variant of a given graph. Rather than modifying the original graph, SwiftNodes suggests to make a copy.
119+
Many algorithms produce a variant of a given graph. Rather than modifying the original graph, SwiftNodes suggests to copy it.
120120

121121
A `graph.copy()` is identical to the original `graph` in IDs, values and structure but contains its own new node- and edge objects. You may also copy just a subset of a graph and limit the included edges and/or nodes:
122122

@@ -145,17 +145,17 @@ SwiftNodes has begun to accumulate [some graph algorithms](https://github.com/co
145145

146146
### Condensation Graph
147147

148-
`graph.makeCondensationGraph()` creates the [condensation graph](https://en.wikipedia.org/wiki/Strongly_connected_component) of the `graph`, which is the graph in which all [strongly connected components](https://en.wikipedia.org/wiki/Strongly_connected_component) of the original graph have been collapsed into single nodes, so the resulting condensation graph is acyclic.
148+
`graph.makeCondensationGraph()` creates the [condensation graph](https://en.wikipedia.org/wiki/Strongly_connected_component) of the `graph`, which is the graph in which all [strongly connected components](https://en.wikipedia.org/wiki/Strongly_connected_component) of the original `graph` have been collapsed into single nodes, so the resulting condensation graph is acyclic.
149149

150150
### Minimum Equivalent Graph
151151

152152
`graph.makeMinimumEquivalentGraph()` creates the [MEG](https://en.wikipedia.org/wiki/Transitive_reduction) of the `graph`. This only works on acyclic graphs and might even hang or crash on cyclic ones.
153153

154154
### Ancestor Counts
155155

156-
`graph.findNumberOfNodeAncestors()` returns a `[(Node, Int)]` containing each node of the graph associated with its ancestor count. The ancestor count is the number of all (recursive) ancestors of the node. Basically, it's the number of other nodes from which the node can be reached.
156+
`graph.findNumberOfNodeAncestors()` returns a `[(Node, Int)]` containing each node of the `graph` together with its ancestor count. The ancestor count is the number of all (recursive) ancestors of the node. Basically, it's the number of other nodes from which the node can be reached.
157157

158-
This only works on acyclic graphs right now and might return incorrect results for some nodes in cyclic graphs.
158+
This only works on acyclic graphs right now and might return incorrect results for nodes in cycles.
159159

160160
Ancestor counts can serve as a proxy for [topological sorting](https://en.wikipedia.org/wiki/Topological_sorting).
161161

@@ -165,7 +165,7 @@ Here is the internal architecture (composition and essential dependencies) of th
165165

166166
![](Documentation/architecture.png)
167167

168-
The above image was created with the [Codeface](https://www.codeface.io) app.
168+
The above image was created with [Codeface](https://www.codeface.io).
169169

170170
## Development Status
171171

0 commit comments

Comments
 (0)