Skip to content

Commit eca2e1d

Browse files
committed
Update README and F# Comparison Doc
1 parent 221f7db commit eca2e1d

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

GLEAM_FSHARP_COMPARISON.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This document compares the Gleam and F# implementations of the Yog graph algorit
1111
| **Package** | [hex.pm/packages/yog](https://hex.pm/packages/yog) | [nuget.org/packages/Yog.FSharp](https://www.nuget.org/packages/Yog.FSharp/) |
1212
| **Documentation** | [HexDocs](https://hexdocs.pm/yog/) | [GitHub Pages](https://code-shoily.github.io/yog-fsharp) |
1313
| **Status** | Stable, Production Ready | 0.5.0 Pre-release |
14-
| **Total Algorithms** | 50+ | 50+ |
15-
| **Lines of Code** | ~10,000 | ~8,500 |
14+
| **Total Algorithms** | 60+ | 50+ |
15+
| **Lines of Code** | ~13,000 | ~8,500 |
1616

1717
## Core Data Structures
1818

@@ -107,6 +107,21 @@ This document compares the Gleam and F# implementations of the Yog graph algorit
107107

108108
**Status**: ✅ Feature parity - All 8 centrality measures in both
109109

110+
## Community Detection
111+
112+
| Algorithm | Gleam | F# | Notes |
113+
| --------- | ------- | ----- | ------- |
114+
| **Louvain** ||| Fast modularity optimization |
115+
| **Leiden** ||| Quality guaranteed partitions |
116+
| **Label Propagation** ||| Near-linear time scaling |
117+
| **Girvan-Newman** ||| Hierarchical edge betweenness |
118+
| **Walktrap** ||| Random walk distances |
119+
| **Infomap** ||| Information-theoretic flow |
120+
| **Clique Percolation** ||| Overlapping communities |
121+
| **Metrics & Modularity** ||| Quality evaluation |
122+
123+
**Status**: ✅ **Gleam exclusive feature**
124+
110125
## Minimum Spanning Trees
111126

112127
| Algorithm | Gleam | F# | Notes |
@@ -244,11 +259,12 @@ This document compares the Gleam and F# implementations of the Yog graph algorit
244259

245260
### Gleam Only
246261

262+
-**Community Detection Suite** - 8 algorithms including Louvain, Leiden, Infomap
247263
-**Complete Network Simplex** - Full min cost flow implementation (930 LOC)
248264
-**Edge Contraction** - Graph transformation
249265
-**Pairing Heap** - Custom priority queue for pathfinding
250266
-**Two-List Queue** - Optimized BFS queue
251-
-**Production Ready** - Stable 0.6.0 release
267+
-**Production Ready** - Stable 5.0.0 release
252268

253269
### F# Only
254270

@@ -279,7 +295,7 @@ This document compares the Gleam and F# implementations of the Yog graph algorit
279295

280296
| Version | Gleam | F# |
281297
| --------- | ------- | ----- |
282-
| **Latest** | 0.6.0 | 0.5.0 |
298+
| **Latest** | 5.0.0 | 0.5.0 |
283299
| **First Release** | 2024 | 2025 |
284300
| **Stability** | Stable | Pre-release |
285301

@@ -323,7 +339,6 @@ This document compares the Gleam and F# implementations of the Yog graph algorit
323339

324340
- [ ] Additional centrality measures
325341
- [ ] Graph isomorphism detection
326-
- [ ] Community detection algorithms
327342
- [ ] Graph coloring algorithms
328343

329344
## Contributing
@@ -346,10 +361,11 @@ Both implementations are **high-quality, feature-rich graph libraries** with exc
346361

347362
**Gleam Strengths:**
348363

364+
- ✅ Community Detection Suite (8 algorithms)
349365
- ✅ Complete Network Simplex (production-ready min cost flow)
350366
- ✅ Edge contraction
351367
- ✅ Battle-tested on BEAM VM
352-
- ✅ Stable 0.6.0 release
368+
- ✅ Stable 5.0.0 release
353369
- ✅ Custom optimized data structures
354370

355371
**F# Strengths:**
@@ -367,5 +383,5 @@ Both implementations are **high-quality, feature-rich graph libraries** with exc
367383
---
368384

369385
**Last Updated**: March 2025
370-
**Gleam Version**: 4.0.0
386+
**Gleam Version**: 5.0.0
371387
**F# Version**: 0.5.0

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ import yog/pathfinding/dijkstra
6666
6767
pub fn main() {
6868
// Create a directed graph
69-
let assert Ok(graph) =
69+
let graph =
7070
yog.directed()
7171
|> yog.add_node(1, "Start")
7272
|> yog.add_node(2, "Middle")
7373
|> yog.add_node(3, "End")
74-
|> yoh.add_edges([
74+
75+
let assert Ok(graph) =
76+
yog.add_edges(graph, [
7577
#(1, 2, 5),
7678
#(2, 3, 3),
7779
#(1, 3, 10)
@@ -158,6 +160,17 @@ Detailed documentation for each algorithm can be found on [HexDocs](https://hexd
158160
| **Bron-Kerbosch** | Maximum and all maximal cliques | O(3^(n/3)) |
159161
| **Network Simplex** | Global minimum cost flow optimization | O(E) pivots |
160162
| **Implicit Search** | Pathfinding/Traversal on on-demand graphs | O((V+E) log V) |
163+
| **PageRank** | Link-quality node importance | O(V+E) per iter |
164+
| **Betweenness** | Bridge/gatekeeper detection | O(VE) or O(V³) |
165+
| **Closeness / Harmonic** | Distance-based importance | O(VE log V) |
166+
| **Eigenvector / Katz** | Influence based on neighbor centrality | O(V+E) per iter |
167+
| **Louvain** | Modularity optimization, large graphs | O(E log V) |
168+
| **Leiden** | Quality guarantee, well-connected communities | O(E log V) |
169+
| **Label Propagation** | Very large graphs, extreme speed | O(E) per iter |
170+
| **Infomap** | Information-theoretic flow tracking | O(E) per iter |
171+
| **Walktrap** | Random-walk structural communities | O(V² log V) |
172+
| **Girvan-Newman** | Hierarchical edge betweenness | O(E²V) |
173+
| **Clique Percolation** | Overlapping community discovery | O(3^(V/3)) |
161174

162175
## Benchmarking
163176

0 commit comments

Comments
 (0)