exonware-xwnode 0.0.1.22__py3-none-any.whl → 0.0.1.23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. exonware/__init__.py +1 -1
  2. exonware/xwnode/__init__.py +18 -5
  3. exonware/xwnode/add_strategy_types.py +165 -0
  4. exonware/xwnode/common/__init__.py +1 -1
  5. exonware/xwnode/common/graph/__init__.py +30 -0
  6. exonware/xwnode/common/graph/caching.py +131 -0
  7. exonware/xwnode/common/graph/contracts.py +100 -0
  8. exonware/xwnode/common/graph/errors.py +44 -0
  9. exonware/xwnode/common/graph/indexing.py +260 -0
  10. exonware/xwnode/common/graph/manager.py +568 -0
  11. exonware/xwnode/common/management/__init__.py +3 -5
  12. exonware/xwnode/common/management/manager.py +2 -2
  13. exonware/xwnode/common/management/migration.py +3 -3
  14. exonware/xwnode/common/monitoring/__init__.py +3 -5
  15. exonware/xwnode/common/monitoring/metrics.py +6 -2
  16. exonware/xwnode/common/monitoring/pattern_detector.py +1 -1
  17. exonware/xwnode/common/monitoring/performance_monitor.py +5 -1
  18. exonware/xwnode/common/patterns/__init__.py +3 -5
  19. exonware/xwnode/common/patterns/flyweight.py +5 -1
  20. exonware/xwnode/common/patterns/registry.py +202 -183
  21. exonware/xwnode/common/utils/__init__.py +25 -11
  22. exonware/xwnode/common/utils/simple.py +1 -1
  23. exonware/xwnode/config.py +3 -8
  24. exonware/xwnode/contracts.py +4 -105
  25. exonware/xwnode/defs.py +413 -159
  26. exonware/xwnode/edges/strategies/__init__.py +86 -4
  27. exonware/xwnode/edges/strategies/_base_edge.py +2 -2
  28. exonware/xwnode/edges/strategies/adj_list.py +287 -121
  29. exonware/xwnode/edges/strategies/adj_matrix.py +316 -222
  30. exonware/xwnode/edges/strategies/base.py +1 -1
  31. exonware/xwnode/edges/strategies/{edge_bidir_wrapper.py → bidir_wrapper.py} +45 -4
  32. exonware/xwnode/edges/strategies/bitemporal.py +520 -0
  33. exonware/xwnode/edges/strategies/{edge_block_adj_matrix.py → block_adj_matrix.py} +77 -6
  34. exonware/xwnode/edges/strategies/bv_graph.py +664 -0
  35. exonware/xwnode/edges/strategies/compressed_graph.py +217 -0
  36. exonware/xwnode/edges/strategies/{edge_coo.py → coo.py} +46 -4
  37. exonware/xwnode/edges/strategies/{edge_csc.py → csc.py} +45 -4
  38. exonware/xwnode/edges/strategies/{edge_csr.py → csr.py} +94 -12
  39. exonware/xwnode/edges/strategies/{edge_dynamic_adj_list.py → dynamic_adj_list.py} +46 -4
  40. exonware/xwnode/edges/strategies/edge_list.py +168 -0
  41. exonware/xwnode/edges/strategies/edge_property_store.py +2 -2
  42. exonware/xwnode/edges/strategies/euler_tour.py +560 -0
  43. exonware/xwnode/edges/strategies/{edge_flow_network.py → flow_network.py} +2 -2
  44. exonware/xwnode/edges/strategies/graphblas.py +449 -0
  45. exonware/xwnode/edges/strategies/hnsw.py +637 -0
  46. exonware/xwnode/edges/strategies/hop2_labels.py +467 -0
  47. exonware/xwnode/edges/strategies/{edge_hyperedge_set.py → hyperedge_set.py} +2 -2
  48. exonware/xwnode/edges/strategies/incidence_matrix.py +250 -0
  49. exonware/xwnode/edges/strategies/k2_tree.py +613 -0
  50. exonware/xwnode/edges/strategies/link_cut.py +626 -0
  51. exonware/xwnode/edges/strategies/multiplex.py +532 -0
  52. exonware/xwnode/edges/strategies/{edge_neural_graph.py → neural_graph.py} +2 -2
  53. exonware/xwnode/edges/strategies/{edge_octree.py → octree.py} +69 -11
  54. exonware/xwnode/edges/strategies/{edge_quadtree.py → quadtree.py} +66 -10
  55. exonware/xwnode/edges/strategies/roaring_adj.py +438 -0
  56. exonware/xwnode/edges/strategies/{edge_rtree.py → rtree.py} +43 -5
  57. exonware/xwnode/edges/strategies/{edge_temporal_edgeset.py → temporal_edgeset.py} +24 -5
  58. exonware/xwnode/edges/strategies/{edge_tree_graph_basic.py → tree_graph_basic.py} +78 -7
  59. exonware/xwnode/edges/strategies/{edge_weighted_graph.py → weighted_graph.py} +188 -10
  60. exonware/xwnode/errors.py +3 -6
  61. exonware/xwnode/facade.py +20 -20
  62. exonware/xwnode/nodes/strategies/__init__.py +29 -9
  63. exonware/xwnode/nodes/strategies/adjacency_list.py +650 -177
  64. exonware/xwnode/nodes/strategies/aho_corasick.py +358 -183
  65. exonware/xwnode/nodes/strategies/array_list.py +36 -3
  66. exonware/xwnode/nodes/strategies/art.py +581 -0
  67. exonware/xwnode/nodes/strategies/{node_avl_tree.py → avl_tree.py} +77 -6
  68. exonware/xwnode/nodes/strategies/{node_b_plus_tree.py → b_plus_tree.py} +81 -40
  69. exonware/xwnode/nodes/strategies/{node_btree.py → b_tree.py} +79 -9
  70. exonware/xwnode/nodes/strategies/base.py +469 -98
  71. exonware/xwnode/nodes/strategies/{node_bitmap.py → bitmap.py} +12 -12
  72. exonware/xwnode/nodes/strategies/{node_bitset_dynamic.py → bitset_dynamic.py} +11 -11
  73. exonware/xwnode/nodes/strategies/{node_bloom_filter.py → bloom_filter.py} +15 -2
  74. exonware/xwnode/nodes/strategies/bloomier_filter.py +519 -0
  75. exonware/xwnode/nodes/strategies/bw_tree.py +531 -0
  76. exonware/xwnode/nodes/strategies/contracts.py +1 -1
  77. exonware/xwnode/nodes/strategies/{node_count_min_sketch.py → count_min_sketch.py} +3 -2
  78. exonware/xwnode/nodes/strategies/{node_cow_tree.py → cow_tree.py} +135 -13
  79. exonware/xwnode/nodes/strategies/crdt_map.py +629 -0
  80. exonware/xwnode/nodes/strategies/{node_cuckoo_hash.py → cuckoo_hash.py} +2 -2
  81. exonware/xwnode/nodes/strategies/{node_xdata_optimized.py → data_interchange_optimized.py} +21 -4
  82. exonware/xwnode/nodes/strategies/dawg.py +876 -0
  83. exonware/xwnode/nodes/strategies/deque.py +321 -153
  84. exonware/xwnode/nodes/strategies/extendible_hash.py +93 -0
  85. exonware/xwnode/nodes/strategies/{node_fenwick_tree.py → fenwick_tree.py} +111 -19
  86. exonware/xwnode/nodes/strategies/hamt.py +403 -0
  87. exonware/xwnode/nodes/strategies/hash_map.py +354 -67
  88. exonware/xwnode/nodes/strategies/heap.py +105 -5
  89. exonware/xwnode/nodes/strategies/hopscotch_hash.py +525 -0
  90. exonware/xwnode/nodes/strategies/{node_hyperloglog.py → hyperloglog.py} +6 -5
  91. exonware/xwnode/nodes/strategies/interval_tree.py +742 -0
  92. exonware/xwnode/nodes/strategies/kd_tree.py +703 -0
  93. exonware/xwnode/nodes/strategies/learned_index.py +533 -0
  94. exonware/xwnode/nodes/strategies/linear_hash.py +93 -0
  95. exonware/xwnode/nodes/strategies/linked_list.py +316 -119
  96. exonware/xwnode/nodes/strategies/{node_lsm_tree.py → lsm_tree.py} +219 -15
  97. exonware/xwnode/nodes/strategies/masstree.py +130 -0
  98. exonware/xwnode/nodes/strategies/{node_persistent_tree.py → persistent_tree.py} +149 -9
  99. exonware/xwnode/nodes/strategies/priority_queue.py +544 -132
  100. exonware/xwnode/nodes/strategies/queue.py +249 -120
  101. exonware/xwnode/nodes/strategies/{node_red_black_tree.py → red_black_tree.py} +183 -72
  102. exonware/xwnode/nodes/strategies/{node_roaring_bitmap.py → roaring_bitmap.py} +19 -6
  103. exonware/xwnode/nodes/strategies/rope.py +717 -0
  104. exonware/xwnode/nodes/strategies/{node_segment_tree.py → segment_tree.py} +106 -106
  105. exonware/xwnode/nodes/strategies/{node_set_hash.py → set_hash.py} +30 -29
  106. exonware/xwnode/nodes/strategies/{node_skip_list.py → skip_list.py} +74 -6
  107. exonware/xwnode/nodes/strategies/sparse_matrix.py +427 -131
  108. exonware/xwnode/nodes/strategies/{node_splay_tree.py → splay_tree.py} +55 -6
  109. exonware/xwnode/nodes/strategies/stack.py +244 -112
  110. exonware/xwnode/nodes/strategies/{node_suffix_array.py → suffix_array.py} +5 -1
  111. exonware/xwnode/nodes/strategies/t_tree.py +94 -0
  112. exonware/xwnode/nodes/strategies/{node_treap.py → treap.py} +75 -6
  113. exonware/xwnode/nodes/strategies/{node_tree_graph_hybrid.py → tree_graph_hybrid.py} +46 -5
  114. exonware/xwnode/nodes/strategies/trie.py +153 -9
  115. exonware/xwnode/nodes/strategies/union_find.py +111 -5
  116. exonware/xwnode/nodes/strategies/veb_tree.py +856 -0
  117. exonware/xwnode/strategies/__init__.py +5 -51
  118. exonware/xwnode/version.py +3 -3
  119. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/METADATA +23 -3
  120. exonware_xwnode-0.0.1.23.dist-info/RECORD +130 -0
  121. exonware/xwnode/edges/strategies/edge_adj_list.py +0 -353
  122. exonware/xwnode/edges/strategies/edge_adj_matrix.py +0 -445
  123. exonware/xwnode/nodes/strategies/_base_node.py +0 -307
  124. exonware/xwnode/nodes/strategies/node_aho_corasick.py +0 -525
  125. exonware/xwnode/nodes/strategies/node_array_list.py +0 -179
  126. exonware/xwnode/nodes/strategies/node_hash_map.py +0 -273
  127. exonware/xwnode/nodes/strategies/node_heap.py +0 -196
  128. exonware/xwnode/nodes/strategies/node_linked_list.py +0 -413
  129. exonware/xwnode/nodes/strategies/node_trie.py +0 -257
  130. exonware/xwnode/nodes/strategies/node_union_find.py +0 -192
  131. exonware/xwnode/queries/executors/__init__.py +0 -47
  132. exonware/xwnode/queries/executors/advanced/__init__.py +0 -37
  133. exonware/xwnode/queries/executors/advanced/aggregate_executor.py +0 -50
  134. exonware/xwnode/queries/executors/advanced/ask_executor.py +0 -50
  135. exonware/xwnode/queries/executors/advanced/construct_executor.py +0 -50
  136. exonware/xwnode/queries/executors/advanced/describe_executor.py +0 -50
  137. exonware/xwnode/queries/executors/advanced/for_loop_executor.py +0 -50
  138. exonware/xwnode/queries/executors/advanced/foreach_executor.py +0 -50
  139. exonware/xwnode/queries/executors/advanced/join_executor.py +0 -50
  140. exonware/xwnode/queries/executors/advanced/let_executor.py +0 -50
  141. exonware/xwnode/queries/executors/advanced/mutation_executor.py +0 -50
  142. exonware/xwnode/queries/executors/advanced/options_executor.py +0 -50
  143. exonware/xwnode/queries/executors/advanced/pipe_executor.py +0 -50
  144. exonware/xwnode/queries/executors/advanced/subscribe_executor.py +0 -50
  145. exonware/xwnode/queries/executors/advanced/subscription_executor.py +0 -50
  146. exonware/xwnode/queries/executors/advanced/union_executor.py +0 -50
  147. exonware/xwnode/queries/executors/advanced/window_executor.py +0 -51
  148. exonware/xwnode/queries/executors/advanced/with_cte_executor.py +0 -50
  149. exonware/xwnode/queries/executors/aggregation/__init__.py +0 -21
  150. exonware/xwnode/queries/executors/aggregation/avg_executor.py +0 -50
  151. exonware/xwnode/queries/executors/aggregation/count_executor.py +0 -38
  152. exonware/xwnode/queries/executors/aggregation/distinct_executor.py +0 -50
  153. exonware/xwnode/queries/executors/aggregation/group_executor.py +0 -50
  154. exonware/xwnode/queries/executors/aggregation/having_executor.py +0 -50
  155. exonware/xwnode/queries/executors/aggregation/max_executor.py +0 -50
  156. exonware/xwnode/queries/executors/aggregation/min_executor.py +0 -50
  157. exonware/xwnode/queries/executors/aggregation/sum_executor.py +0 -50
  158. exonware/xwnode/queries/executors/aggregation/summarize_executor.py +0 -50
  159. exonware/xwnode/queries/executors/array/__init__.py +0 -9
  160. exonware/xwnode/queries/executors/array/indexing_executor.py +0 -51
  161. exonware/xwnode/queries/executors/array/slicing_executor.py +0 -51
  162. exonware/xwnode/queries/executors/base.py +0 -257
  163. exonware/xwnode/queries/executors/capability_checker.py +0 -204
  164. exonware/xwnode/queries/executors/contracts.py +0 -166
  165. exonware/xwnode/queries/executors/core/__init__.py +0 -17
  166. exonware/xwnode/queries/executors/core/create_executor.py +0 -96
  167. exonware/xwnode/queries/executors/core/delete_executor.py +0 -99
  168. exonware/xwnode/queries/executors/core/drop_executor.py +0 -100
  169. exonware/xwnode/queries/executors/core/insert_executor.py +0 -39
  170. exonware/xwnode/queries/executors/core/select_executor.py +0 -152
  171. exonware/xwnode/queries/executors/core/update_executor.py +0 -102
  172. exonware/xwnode/queries/executors/data/__init__.py +0 -13
  173. exonware/xwnode/queries/executors/data/alter_executor.py +0 -50
  174. exonware/xwnode/queries/executors/data/load_executor.py +0 -50
  175. exonware/xwnode/queries/executors/data/merge_executor.py +0 -50
  176. exonware/xwnode/queries/executors/data/store_executor.py +0 -50
  177. exonware/xwnode/queries/executors/defs.py +0 -93
  178. exonware/xwnode/queries/executors/engine.py +0 -221
  179. exonware/xwnode/queries/executors/errors.py +0 -68
  180. exonware/xwnode/queries/executors/filtering/__init__.py +0 -25
  181. exonware/xwnode/queries/executors/filtering/between_executor.py +0 -80
  182. exonware/xwnode/queries/executors/filtering/filter_executor.py +0 -79
  183. exonware/xwnode/queries/executors/filtering/has_executor.py +0 -70
  184. exonware/xwnode/queries/executors/filtering/in_executor.py +0 -70
  185. exonware/xwnode/queries/executors/filtering/like_executor.py +0 -76
  186. exonware/xwnode/queries/executors/filtering/optional_executor.py +0 -76
  187. exonware/xwnode/queries/executors/filtering/range_executor.py +0 -80
  188. exonware/xwnode/queries/executors/filtering/term_executor.py +0 -77
  189. exonware/xwnode/queries/executors/filtering/values_executor.py +0 -71
  190. exonware/xwnode/queries/executors/filtering/where_executor.py +0 -44
  191. exonware/xwnode/queries/executors/graph/__init__.py +0 -15
  192. exonware/xwnode/queries/executors/graph/in_traverse_executor.py +0 -51
  193. exonware/xwnode/queries/executors/graph/match_executor.py +0 -51
  194. exonware/xwnode/queries/executors/graph/out_executor.py +0 -51
  195. exonware/xwnode/queries/executors/graph/path_executor.py +0 -51
  196. exonware/xwnode/queries/executors/graph/return_executor.py +0 -51
  197. exonware/xwnode/queries/executors/ordering/__init__.py +0 -9
  198. exonware/xwnode/queries/executors/ordering/by_executor.py +0 -50
  199. exonware/xwnode/queries/executors/ordering/order_executor.py +0 -51
  200. exonware/xwnode/queries/executors/projection/__init__.py +0 -9
  201. exonware/xwnode/queries/executors/projection/extend_executor.py +0 -50
  202. exonware/xwnode/queries/executors/projection/project_executor.py +0 -50
  203. exonware/xwnode/queries/executors/registry.py +0 -173
  204. exonware/xwnode/queries/parsers/__init__.py +0 -26
  205. exonware/xwnode/queries/parsers/base.py +0 -86
  206. exonware/xwnode/queries/parsers/contracts.py +0 -46
  207. exonware/xwnode/queries/parsers/errors.py +0 -53
  208. exonware/xwnode/queries/parsers/sql_param_extractor.py +0 -318
  209. exonware/xwnode/queries/strategies/__init__.py +0 -24
  210. exonware/xwnode/queries/strategies/base.py +0 -236
  211. exonware/xwnode/queries/strategies/cql.py +0 -201
  212. exonware/xwnode/queries/strategies/cypher.py +0 -181
  213. exonware/xwnode/queries/strategies/datalog.py +0 -70
  214. exonware/xwnode/queries/strategies/elastic_dsl.py +0 -70
  215. exonware/xwnode/queries/strategies/eql.py +0 -70
  216. exonware/xwnode/queries/strategies/flux.py +0 -70
  217. exonware/xwnode/queries/strategies/gql.py +0 -70
  218. exonware/xwnode/queries/strategies/graphql.py +0 -240
  219. exonware/xwnode/queries/strategies/gremlin.py +0 -181
  220. exonware/xwnode/queries/strategies/hiveql.py +0 -214
  221. exonware/xwnode/queries/strategies/hql.py +0 -70
  222. exonware/xwnode/queries/strategies/jmespath.py +0 -219
  223. exonware/xwnode/queries/strategies/jq.py +0 -66
  224. exonware/xwnode/queries/strategies/json_query.py +0 -66
  225. exonware/xwnode/queries/strategies/jsoniq.py +0 -248
  226. exonware/xwnode/queries/strategies/kql.py +0 -70
  227. exonware/xwnode/queries/strategies/linq.py +0 -238
  228. exonware/xwnode/queries/strategies/logql.py +0 -70
  229. exonware/xwnode/queries/strategies/mql.py +0 -68
  230. exonware/xwnode/queries/strategies/n1ql.py +0 -210
  231. exonware/xwnode/queries/strategies/partiql.py +0 -70
  232. exonware/xwnode/queries/strategies/pig.py +0 -215
  233. exonware/xwnode/queries/strategies/promql.py +0 -70
  234. exonware/xwnode/queries/strategies/sparql.py +0 -220
  235. exonware/xwnode/queries/strategies/sql.py +0 -275
  236. exonware/xwnode/queries/strategies/xml_query.py +0 -66
  237. exonware/xwnode/queries/strategies/xpath.py +0 -223
  238. exonware/xwnode/queries/strategies/xquery.py +0 -258
  239. exonware/xwnode/queries/strategies/xwnode_executor.py +0 -332
  240. exonware/xwnode/queries/strategies/xwquery.py +0 -456
  241. exonware_xwnode-0.0.1.22.dist-info/RECORD +0 -214
  242. /exonware/xwnode/nodes/strategies/{node_ordered_map.py → ordered_map.py} +0 -0
  243. /exonware/xwnode/nodes/strategies/{node_ordered_map_balanced.py → ordered_map_balanced.py} +0 -0
  244. /exonware/xwnode/nodes/strategies/{node_patricia.py → patricia.py} +0 -0
  245. /exonware/xwnode/nodes/strategies/{node_radix_trie.py → radix_trie.py} +0 -0
  246. /exonware/xwnode/nodes/strategies/{node_set_tree.py → set_tree.py} +0 -0
  247. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/WHEEL +0 -0
  248. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/licenses/LICENSE +0 -0
exonware/xwnode/defs.py CHANGED
@@ -1,13 +1,13 @@
1
1
  """
2
- GEMINI-2 Strategy Types and Enums
3
-
4
- This module defines all the enums and types for the GEMINI-2 strategy system:
5
- - NodeMode: 28 different node data structure strategies
6
- - EdgeMode: 16 different edge storage strategies
7
- - QueryMode: 19 different query language strategies
8
- - NodeTrait: 12 cross-cutting node capabilities
9
- - EdgeTrait: 12 cross-cutting edge capabilities
10
- - QueryTrait: 8 cross-cutting query capabilities
2
+ XWNode Strategy Types and Enums
3
+
4
+ This module defines all the enums and types for the XWNode strategy system:
5
+ - NodeMode: 49 different node data structure strategies (including DATA_INTERCHANGE_OPTIMIZED)
6
+ - EdgeMode: 22 different edge storage strategies
7
+ - NodeTrait: Cross-cutting node capabilities
8
+ - EdgeTrait: Cross-cutting edge capabilities
9
+
10
+ Note: Query-related enums (QueryMode, QueryTrait) are in xwquery.defs module.
11
11
  """
12
12
 
13
13
  from enum import Enum, Flag, auto as _auto
@@ -15,11 +15,11 @@ from typing import Dict, List, Any, Optional
15
15
 
16
16
 
17
17
  # ============================================================================
18
- # NODE MODES (28 total)
18
+ # NODE MODES (57 total)
19
19
  # ============================================================================
20
20
 
21
21
  class NodeMode(Enum):
22
- """Node data structure strategies for GEMINI-2."""
22
+ """Node data structure strategies for GEMINI-2 (57 total)."""
23
23
 
24
24
  # Special modes
25
25
  AUTO = _auto() # Intelligent automatic selection
@@ -87,14 +87,37 @@ class NodeMode(Enum):
87
87
  AVL_TREE = _auto() # Strictly balanced binary search tree
88
88
  TREAP = _auto() # Randomized balanced tree
89
89
  SPLAY_TREE = _auto() # Self-adjusting binary search tree
90
+
91
+ # High-performance structures (NEW)
92
+ ART = _auto() # Adaptive Radix Tree
93
+ BW_TREE = _auto() # Lock-Free B-tree (Bw-Tree)
94
+ HAMT = _auto() # Hash Array Mapped Trie
95
+ MASSTREE = _auto() # B+ tree + trie hybrid
96
+ EXTENDIBLE_HASH = _auto() # Dynamic hash table
97
+ LINEAR_HASH = _auto() # Linear dynamic hashing
98
+ T_TREE = _auto() # In-memory T-tree
99
+ LEARNED_INDEX = _auto() # ML-based learned indexes (experimental)
100
+
101
+ # Data interchange structures
102
+ DATA_INTERCHANGE_OPTIMIZED = _auto() # Ultra-lightweight for data interchange (COW, pooling, hash caching)
103
+
104
+ # Advanced specialized structures
105
+ VEB_TREE = _auto() # van Emde Boas tree - O(log log U) integer ops
106
+ DAWG = _auto() # DAWG/DAFSA - minimal automaton for strings
107
+ HOPSCOTCH_HASH = _auto() # Hopscotch hashing - bounded neighborhood search
108
+ INTERVAL_TREE = _auto() # Interval overlap queries - scheduling, genomics
109
+ KD_TREE = _auto() # k-dimensional spatial tree - point queries
110
+ ROPE = _auto() # Rope structure - efficient text operations
111
+ CRDT_MAP = _auto() # Conflict-free replicated map - distributed systems
112
+ BLOOMIER_FILTER = _auto() # Probabilistic key→value map - approximate dictionaries
90
113
 
91
114
 
92
115
  # ============================================================================
93
- # EDGE MODES (16 total)
116
+ # EDGE MODES (28 total)
94
117
  # ============================================================================
95
118
 
96
119
  class EdgeMode(Enum):
97
- """Edge storage strategies for GEMINI-2."""
120
+ """Edge storage strategies for GEMINI-2 (28 total)."""
98
121
 
99
122
  # Special modes
100
123
  AUTO = _auto() # Intelligent automatic selection
@@ -128,6 +151,46 @@ class EdgeMode(Enum):
128
151
 
129
152
  # Weighted graph structures
130
153
  WEIGHTED_GRAPH = _auto() # Graph with numerical edge weights
154
+
155
+ # Graph representation structures (NEW)
156
+ INCIDENCE_MATRIX = _auto() # Incidence matrix representation
157
+ EDGE_LIST = _auto() # Simple edge list format
158
+ COMPRESSED_GRAPH = _auto() # WebGraph/LLP compression
159
+
160
+ # Advanced graph structures
161
+ K2_TREE = _auto() # k²-tree ultra-compact adjacency
162
+ BV_GRAPH = _auto() # BVGraph full WebGraph with Elias coding
163
+ HNSW = _auto() # Hierarchical Navigable Small World - ANN search
164
+ EULER_TOUR = _auto() # Euler tour trees - dynamic connectivity
165
+ LINK_CUT = _auto() # Link-cut trees - dynamic trees with path queries
166
+ HOP2_LABELS = _auto() # 2-hop labeling - fast reachability queries
167
+ GRAPHBLAS = _auto() # GraphBLAS semiring-based operations
168
+ ROARING_ADJ = _auto() # Roaring bitmap adjacency - fast set operations
169
+ MULTIPLEX = _auto() # Multiplex/layered edges - multi-layer graphs
170
+ BITEMPORAL = _auto() # Bitemporal edges - valid and transaction time
171
+
172
+
173
+ # ============================================================================
174
+ # GRAPH OPTIMIZATION (4 levels)
175
+ # ============================================================================
176
+
177
+ class GraphOptimization(Enum):
178
+ """
179
+ Graph optimization levels for XWGraphManager.
180
+
181
+ Controls indexing and caching behavior for performance tuning.
182
+ """
183
+
184
+ OFF = 0 # No optimization - fallback to O(n) iteration
185
+ INDEX_ONLY = 1 # Only indexing - O(1) lookups, no caching
186
+ CACHE_ONLY = 2 # Only caching - benefits from repeated queries
187
+ FULL = 3 # Both indexing + caching - maximum performance
188
+
189
+ # Aliases for clarity
190
+ DISABLED = 0
191
+ MINIMAL = 1
192
+ MODERATE = 2
193
+ MAXIMUM = 3
131
194
 
132
195
 
133
196
  # ============================================================================
@@ -200,6 +263,7 @@ class EdgeTrait(Flag):
200
263
  SPATIAL = _auto() # Spatial operations
201
264
  TEMPORAL = _auto() # Time-aware edges
202
265
  HYPER = _auto() # Hyperedge support
266
+ HIERARCHICAL = _auto() # Hierarchical/tree structure
203
267
 
204
268
  # Performance capabilities
205
269
  DENSE = _auto() # Dense graph optimized
@@ -208,95 +272,6 @@ class EdgeTrait(Flag):
208
272
  COLUMNAR = _auto() # Columnar storage
209
273
 
210
274
 
211
- # ============================================================================
212
- # QUERY MODES (35 total)
213
- # ============================================================================
214
-
215
- class QueryMode(Enum):
216
- """Query language strategies for GEMINI-2."""
217
-
218
- # Special modes
219
- AUTO = _auto() # Intelligent automatic selection
220
-
221
- # Structured & Document Query Languages
222
- SQL = _auto() # Standard SQL
223
- HIVEQL = _auto() # Apache Hive SQL
224
- PIG = _auto() # Apache Pig Latin
225
- CQL = _auto() # Cassandra Query Language
226
- N1QL = _auto() # Couchbase N1QL
227
- KQL = _auto() # Kusto Query Language
228
- DATALOG = _auto() # Datalog
229
- MQL = _auto() # MongoDB Query Language
230
- PARTIQL = _auto() # AWS PartiQL (SQL-compatible for nested/semi-structured)
231
-
232
- # Search Query Languages
233
- ELASTIC_DSL = _auto() # Elasticsearch Query DSL
234
- EQL = _auto() # Elasticsearch Event Query Language
235
- LUCENE = _auto() # Lucene query syntax
236
-
237
- # Time Series & Monitoring
238
- FLUX = _auto() # InfluxDB Flux
239
- PROMQL = _auto() # Prometheus Query Language
240
-
241
- # Data Streaming
242
- KSQL = _auto() # Kafka Streams (ksqlDB)
243
-
244
- # Graph Query Languages
245
- GRAPHQL = _auto() # GraphQL
246
- SPARQL = _auto() # SPARQL (RDF)
247
- GREMLIN = _auto() # Apache TinkerPop Gremlin
248
- CYPHER = _auto() # Neo4j Cypher
249
- GQL = _auto() # ISO/IEC 39075:2024 Graph Query Language standard
250
-
251
- # ORM / Integrated Query
252
- LINQ = _auto() # .NET Language Integrated Query
253
- HQL = _auto() # Hibernate Query Language / JPQL
254
-
255
- # Markup & Document Structure
256
- JSONIQ = _auto() # JSONiq
257
- JMESPATH = _auto() # JMESPath
258
- JQ = _auto() # jq JSON processor
259
- XQUERY = _auto() # XQuery
260
- XPATH = _auto() # XPath
261
-
262
- # Logs & Analytics
263
- LOGQL = _auto() # Grafana Loki Log Query Language
264
- SPL = _auto() # Splunk Search Processing Language
265
-
266
- # SQL Engines
267
- TRINO_SQL = _auto() # Trino/Presto SQL
268
- BIGQUERY_SQL = _auto() # Google BigQuery SQL
269
- SNOWFLAKE_SQL = _auto() # Snowflake SQL
270
-
271
- # Generic Query Languages
272
- XML_QUERY = _auto() # Generic XML Query
273
- JSON_QUERY = _auto() # Generic JSON Query
274
-
275
-
276
- # ============================================================================
277
- # QUERY TRAITS (8 total)
278
- # ============================================================================
279
-
280
- class QueryTrait(Flag):
281
- """Cross-cutting query capabilities for GEMINI-2."""
282
-
283
- NONE = 0
284
-
285
- # Basic capabilities
286
- STRUCTURED = _auto() # Structured data queries
287
- GRAPH = _auto() # Graph traversal queries
288
- DOCUMENT = _auto() # Document-based queries
289
-
290
- # Advanced capabilities
291
- TEMPORAL = _auto() # Time-aware queries
292
- SPATIAL = _auto() # Spatial queries
293
- ANALYTICAL = _auto() # Analytical queries
294
-
295
- # Performance capabilities
296
- STREAMING = _auto() # Streaming queries
297
- BATCH = _auto() # Batch processing queries
298
-
299
-
300
275
  # ============================================================================
301
276
  # CONVENIENCE CONSTANTS
302
277
  # ============================================================================
@@ -345,6 +320,23 @@ RED_BLACK_TREE = NodeMode.RED_BLACK_TREE
345
320
  AVL_TREE = NodeMode.AVL_TREE
346
321
  TREAP = NodeMode.TREAP
347
322
  SPLAY_TREE = NodeMode.SPLAY_TREE
323
+ ART = NodeMode.ART
324
+ BW_TREE = NodeMode.BW_TREE
325
+ HAMT = NodeMode.HAMT
326
+ MASSTREE = NodeMode.MASSTREE
327
+ EXTENDIBLE_HASH = NodeMode.EXTENDIBLE_HASH
328
+ LINEAR_HASH = NodeMode.LINEAR_HASH
329
+ T_TREE = NodeMode.T_TREE
330
+ LEARNED_INDEX = NodeMode.LEARNED_INDEX
331
+ DATA_INTERCHANGE_OPTIMIZED = NodeMode.DATA_INTERCHANGE_OPTIMIZED
332
+ VEB_TREE = NodeMode.VEB_TREE
333
+ DAWG = NodeMode.DAWG
334
+ HOPSCOTCH_HASH = NodeMode.HOPSCOTCH_HASH
335
+ INTERVAL_TREE = NodeMode.INTERVAL_TREE
336
+ KD_TREE = NodeMode.KD_TREE
337
+ ROPE = NodeMode.ROPE
338
+ CRDT_MAP = NodeMode.CRDT_MAP
339
+ BLOOMIER_FILTER = NodeMode.BLOOMIER_FILTER
348
340
 
349
341
  # Edge Mode Constants
350
342
  ADJ_LIST = EdgeMode.ADJ_LIST
@@ -363,61 +355,19 @@ QUADTREE = EdgeMode.QUADTREE
363
355
  OCTREE = EdgeMode.OCTREE
364
356
  TREE_GRAPH_BASIC = EdgeMode.TREE_GRAPH_BASIC
365
357
  WEIGHTED_GRAPH = EdgeMode.WEIGHTED_GRAPH
366
-
367
- # Query Mode Constants
368
- # Structured & Document Query Languages
369
- SQL = QueryMode.SQL
370
- HIVEQL = QueryMode.HIVEQL
371
- PIG = QueryMode.PIG
372
- CQL = QueryMode.CQL
373
- N1QL = QueryMode.N1QL
374
- KQL = QueryMode.KQL
375
- DATALOG = QueryMode.DATALOG
376
- MQL = QueryMode.MQL
377
- PARTIQL = QueryMode.PARTIQL
378
-
379
- # Search Query Languages
380
- ELASTIC_DSL = QueryMode.ELASTIC_DSL
381
- EQL = QueryMode.EQL
382
- LUCENE = QueryMode.LUCENE
383
-
384
- # Time Series & Monitoring
385
- FLUX = QueryMode.FLUX
386
- PROMQL = QueryMode.PROMQL
387
-
388
- # Data Streaming
389
- KSQL = QueryMode.KSQL
390
-
391
- # Graph Query Languages
392
- GRAPHQL = QueryMode.GRAPHQL
393
- SPARQL = QueryMode.SPARQL
394
- GREMLIN = QueryMode.GREMLIN
395
- CYPHER = QueryMode.CYPHER
396
- GQL = QueryMode.GQL
397
-
398
- # ORM / Integrated Query
399
- LINQ = QueryMode.LINQ
400
- HQL = QueryMode.HQL
401
-
402
- # Markup & Document Structure
403
- JSONIQ = QueryMode.JSONIQ
404
- JMESPATH = QueryMode.JMESPATH
405
- JQ = QueryMode.JQ
406
- XQUERY = QueryMode.XQUERY
407
- XPATH = QueryMode.XPATH
408
-
409
- # Logs & Analytics
410
- LOGQL = QueryMode.LOGQL
411
- SPL = QueryMode.SPL
412
-
413
- # SQL Engines
414
- TRINO_SQL = QueryMode.TRINO_SQL
415
- BIGQUERY_SQL = QueryMode.BIGQUERY_SQL
416
- SNOWFLAKE_SQL = QueryMode.SNOWFLAKE_SQL
417
-
418
- # Generic Query Languages
419
- XML_QUERY = QueryMode.XML_QUERY
420
- JSON_QUERY = QueryMode.JSON_QUERY
358
+ INCIDENCE_MATRIX = EdgeMode.INCIDENCE_MATRIX
359
+ EDGE_LIST = EdgeMode.EDGE_LIST
360
+ COMPRESSED_GRAPH = EdgeMode.COMPRESSED_GRAPH
361
+ K2_TREE = EdgeMode.K2_TREE
362
+ BV_GRAPH = EdgeMode.BV_GRAPH
363
+ HNSW = EdgeMode.HNSW
364
+ EULER_TOUR = EdgeMode.EULER_TOUR
365
+ LINK_CUT = EdgeMode.LINK_CUT
366
+ HOP2_LABELS = EdgeMode.HOP2_LABELS
367
+ GRAPHBLAS = EdgeMode.GRAPHBLAS
368
+ ROARING_ADJ = EdgeMode.ROARING_ADJ
369
+ MULTIPLEX = EdgeMode.MULTIPLEX
370
+ BITEMPORAL = EdgeMode.BITEMPORAL
421
371
 
422
372
 
423
373
  # ============================================================================
@@ -428,8 +378,8 @@ class StrategyMetadata:
428
378
  """Metadata for strategy modes including capabilities and performance characteristics."""
429
379
 
430
380
  def __init__(self,
431
- mode: NodeMode | EdgeMode | QueryMode,
432
- traits: NodeTrait | EdgeTrait | QueryTrait,
381
+ mode: NodeMode | EdgeMode,
382
+ traits: NodeTrait | EdgeTrait,
433
383
  description: str,
434
384
  best_for: List[str],
435
385
  performance_gain: str,
@@ -634,6 +584,178 @@ NODE_STRATEGY_METADATA: Dict[NodeMode, StrategyMetadata] = {
634
584
  "very low",
635
585
  {"contains": "O(1)", "add": "O(1)", "remove": "O(1)"}
636
586
  ),
587
+
588
+ # NEW High-Performance Strategies
589
+ NodeMode.ART: StrategyMetadata(
590
+ NodeMode.ART,
591
+ NodeTrait.ORDERED | NodeTrait.INDEXED | NodeTrait.PREFIX_TREE,
592
+ "Adaptive Radix Tree for string keys",
593
+ ["string keys", "prefix search", "memory efficiency"],
594
+ "3-10x faster than B-trees for strings",
595
+ "low",
596
+ {"get": "O(k)", "set": "O(k)", "delete": "O(k)"}
597
+ ),
598
+
599
+ NodeMode.BW_TREE: StrategyMetadata(
600
+ NodeMode.BW_TREE,
601
+ NodeTrait.ORDERED | NodeTrait.INDEXED,
602
+ "Lock-free B-tree with delta updates",
603
+ ["concurrent access", "lock-free", "cache-optimized"],
604
+ "Lock-free operations, high concurrency",
605
+ "medium",
606
+ {"get": "O(log n)", "set": "O(log n)", "delete": "O(log n)"}
607
+ ),
608
+
609
+ NodeMode.HAMT: StrategyMetadata(
610
+ NodeMode.HAMT,
611
+ NodeTrait.INDEXED | NodeTrait.PERSISTENT,
612
+ "Hash Array Mapped Trie with structural sharing",
613
+ ["persistent data", "functional programming", "immutable"],
614
+ "Structural sharing, memory efficient",
615
+ "medium",
616
+ {"get": "O(log32 n)", "set": "O(log32 n)", "delete": "O(log32 n)"}
617
+ ),
618
+
619
+ NodeMode.MASSTREE: StrategyMetadata(
620
+ NodeMode.MASSTREE,
621
+ NodeTrait.ORDERED | NodeTrait.INDEXED | NodeTrait.PREFIX_TREE,
622
+ "B+ tree + trie hybrid for cache locality",
623
+ ["cache-optimized", "variable keys", "high performance"],
624
+ "Cache-friendly, fast key comparison",
625
+ "medium",
626
+ {"get": "O(log n)", "set": "O(log n)", "delete": "O(log n)"}
627
+ ),
628
+
629
+ NodeMode.EXTENDIBLE_HASH: StrategyMetadata(
630
+ NodeMode.EXTENDIBLE_HASH,
631
+ NodeTrait.INDEXED,
632
+ "Directory-based dynamic hash table",
633
+ ["dynamic hashing", "no full rehash", "grows incrementally"],
634
+ "Split buckets without full rehashing",
635
+ "medium",
636
+ {"get": "O(1)", "set": "O(1)", "delete": "O(1)"}
637
+ ),
638
+
639
+ NodeMode.LINEAR_HASH: StrategyMetadata(
640
+ NodeMode.LINEAR_HASH,
641
+ NodeTrait.INDEXED,
642
+ "Linear dynamic hashing without directory",
643
+ ["dynamic hashing", "no directory overhead", "gradual growth"],
644
+ "Linear bucket splitting, no directory",
645
+ "low",
646
+ {"get": "O(1)", "set": "O(1)", "delete": "O(1)"}
647
+ ),
648
+
649
+ NodeMode.T_TREE: StrategyMetadata(
650
+ NodeMode.T_TREE,
651
+ NodeTrait.ORDERED | NodeTrait.INDEXED,
652
+ "Hybrid AVL tree + array nodes for in-memory",
653
+ ["in-memory", "reduced pointers", "cache-friendly"],
654
+ "Optimized for in-memory databases",
655
+ "medium",
656
+ {"get": "O(log n)", "set": "O(log n)", "delete": "O(log n)"}
657
+ ),
658
+
659
+ NodeMode.LEARNED_INDEX: StrategyMetadata(
660
+ NodeMode.LEARNED_INDEX,
661
+ NodeTrait.ORDERED | NodeTrait.INDEXED,
662
+ "ML-based learned index (EXPERIMENTAL)",
663
+ ["machine learning", "adaptive", "research"],
664
+ "10-100x faster lookups (when fully implemented)",
665
+ "medium",
666
+ {"get": "O(1) amortized", "set": "O(log n)", "delete": "O(log n)"}
667
+ ),
668
+
669
+ NodeMode.DATA_INTERCHANGE_OPTIMIZED: StrategyMetadata(
670
+ NodeMode.DATA_INTERCHANGE_OPTIMIZED,
671
+ NodeTrait.INDEXED,
672
+ "Ultra-lightweight hash map with COW, pooling, and hash caching",
673
+ ["data interchange", "serialization", "format conversion", "copy-on-write"],
674
+ "Optimized for data interchange patterns with minimal overhead",
675
+ "very low",
676
+ {"get": "O(1)", "set": "O(1)", "delete": "O(1)", "copy": "O(1) lazy"}
677
+ ),
678
+
679
+ # Advanced specialized structures
680
+ NodeMode.VEB_TREE: StrategyMetadata(
681
+ NodeMode.VEB_TREE,
682
+ NodeTrait.ORDERED | NodeTrait.INDEXED | NodeTrait.FAST_INSERT,
683
+ "van Emde Boas tree for O(log log U) integer operations",
684
+ ["routing tables", "IP lookups", "small universe integers", "priority queues"],
685
+ "Faster than BST for small universes: O(log log U) vs O(log n)",
686
+ "high",
687
+ {"get": "O(log log U)", "set": "O(log log U)", "delete": "O(log log U)", "min/max": "O(1)"}
688
+ ),
689
+
690
+ NodeMode.DAWG: StrategyMetadata(
691
+ NodeMode.DAWG,
692
+ NodeTrait.HIERARCHICAL | NodeTrait.INDEXED | NodeTrait.MEMORY_EFFICIENT | NodeTrait.PREFIX_TREE,
693
+ "DAWG/DAFSA minimal automaton for string sets",
694
+ ["dictionaries", "lexicons", "spell check", "autocomplete", "genomics"],
695
+ "10-100x memory savings vs trie through suffix sharing",
696
+ "very low",
697
+ {"get": "O(k)", "insert": "O(k)", "prefix_query": "O(k+m)"}
698
+ ),
699
+
700
+ NodeMode.HOPSCOTCH_HASH: StrategyMetadata(
701
+ NodeMode.HOPSCOTCH_HASH,
702
+ NodeTrait.INDEXED | NodeTrait.FAST_INSERT | NodeTrait.FAST_DELETE,
703
+ "Hopscotch hashing with bounded neighborhood search",
704
+ ["cache-friendly hash", "embedded systems", "high load factors", "predictable performance"],
705
+ "Better cache behavior than cuckoo, supports >90% load",
706
+ "medium",
707
+ {"get": "O(H)", "set": "O(H)", "delete": "O(H)"} # H=32 typical
708
+ ),
709
+
710
+ NodeMode.INTERVAL_TREE: StrategyMetadata(
711
+ NodeMode.INTERVAL_TREE,
712
+ NodeTrait.ORDERED | NodeTrait.INDEXED | NodeTrait.HIERARCHICAL,
713
+ "Augmented tree for interval overlap queries",
714
+ ["scheduling", "genomics", "collision detection", "time windows", "range caching"],
715
+ "O(log n + k) overlap queries vs O(n) scan",
716
+ "medium",
717
+ {"insert": "O(log n)", "delete": "O(log n)", "overlaps": "O(log n + k)"}
718
+ ),
719
+
720
+ NodeMode.KD_TREE: StrategyMetadata(
721
+ NodeMode.KD_TREE,
722
+ NodeTrait.SPATIAL | NodeTrait.INDEXED | NodeTrait.HIERARCHICAL,
723
+ "k-dimensional tree for multi-dimensional point queries",
724
+ ["2D/3D points", "k-NN search", "spatial indexing", "graphics", "ML"],
725
+ "O(log n) nearest neighbor for low dimensions",
726
+ "medium",
727
+ {"insert": "O(log n)", "search": "O(log n)", "knn": "O(log n)"}
728
+ ),
729
+
730
+ NodeMode.ROPE: StrategyMetadata(
731
+ NodeMode.ROPE,
732
+ NodeTrait.HIERARCHICAL | NodeTrait.FAST_INSERT | NodeTrait.FAST_DELETE,
733
+ "Binary tree for efficient text/string operations",
734
+ ["text editors", "large documents", "undo/redo", "collaborative editing"],
735
+ "O(log n) insert/delete vs O(n) for strings",
736
+ "medium",
737
+ {"index": "O(log n)", "concat": "O(log n)", "split": "O(log n)", "insert": "O(log n)"}
738
+ ),
739
+
740
+ NodeMode.CRDT_MAP: StrategyMetadata(
741
+ NodeMode.CRDT_MAP,
742
+ NodeTrait.INDEXED | NodeTrait.PERSISTENT | NodeTrait.STREAMING,
743
+ "Conflict-free replicated map for distributed systems",
744
+ ["distributed databases", "offline-first apps", "collaborative editing", "multi-master"],
745
+ "Conflict-free merging with eventual consistency",
746
+ "high",
747
+ {"put": "O(1)", "get": "O(1)", "merge": "O(m)"}
748
+ ),
749
+
750
+ NodeMode.BLOOMIER_FILTER: StrategyMetadata(
751
+ NodeMode.BLOOMIER_FILTER,
752
+ NodeTrait.PROBABILISTIC | NodeTrait.MEMORY_EFFICIENT | NodeTrait.INDEXED,
753
+ "Probabilistic key→value map with false positives",
754
+ ["approximate caches", "distributed sketches", "memory-constrained", "spell check"],
755
+ "10-100x memory savings vs hash map with controlled FP rate",
756
+ "very low",
757
+ {"get": "O(k)", "contains": "O(k)"} # k = hash functions
758
+ ),
637
759
  }
638
760
 
639
761
 
@@ -727,6 +849,138 @@ EDGE_STRATEGY_METADATA: Dict[EdgeMode, StrategyMetadata] = {
727
849
  "medium",
728
850
  {"add_hyperedge": "O(1)", "remove_hyperedge": "O(1)", "incident_edges": "O(degree)"}
729
851
  ),
852
+
853
+ # NEW Graph Representation Strategies
854
+ EdgeMode.INCIDENCE_MATRIX: StrategyMetadata(
855
+ EdgeMode.INCIDENCE_MATRIX,
856
+ EdgeTrait.SPARSE | EdgeTrait.DIRECTED | EdgeTrait.WEIGHTED,
857
+ "Incidence matrix for edge-centric queries",
858
+ ["edge properties", "edge-centric", "graph theory"],
859
+ "Optimal for edge-focused operations",
860
+ "medium",
861
+ {"add_edge": "O(1)", "remove_edge": "O(1)", "edge_properties": "O(1)"}
862
+ ),
863
+
864
+ EdgeMode.EDGE_LIST: StrategyMetadata(
865
+ EdgeMode.EDGE_LIST,
866
+ EdgeTrait.SPARSE | EdgeTrait.DIRECTED,
867
+ "Simple edge list format",
868
+ ["minimal storage", "edge list files", "simple graphs"],
869
+ "Minimal overhead, simple format",
870
+ "low",
871
+ {"add_edge": "O(1)", "remove_edge": "O(n)", "neighbors": "O(m)"}
872
+ ),
873
+
874
+ EdgeMode.COMPRESSED_GRAPH: StrategyMetadata(
875
+ EdgeMode.COMPRESSED_GRAPH,
876
+ EdgeTrait.SPARSE | EdgeTrait.COMPRESSED,
877
+ "WebGraph/LLP compression for power-law graphs",
878
+ ["web graphs", "social networks", "high compression"],
879
+ "100x compression for power-law graphs",
880
+ "very low",
881
+ {"add_edge": "O(1)", "neighbors": "O(degree)", "compression": "100x"}
882
+ ),
883
+
884
+ # Advanced graph structures
885
+ EdgeMode.K2_TREE: StrategyMetadata(
886
+ EdgeMode.K2_TREE,
887
+ EdgeTrait.SPARSE | EdgeTrait.COMPRESSED,
888
+ "k²-tree ultra-compact adjacency with quadtree compression",
889
+ ["web graphs", "social networks", "billions of edges", "memory-constrained"],
890
+ "2-10 bits per edge for power-law graphs",
891
+ "very low",
892
+ {"add_edge": "O(log n)", "has_edge": "O(log n)", "neighbors": "O(log n + degree)"}
893
+ ),
894
+
895
+ EdgeMode.BV_GRAPH: StrategyMetadata(
896
+ EdgeMode.BV_GRAPH,
897
+ EdgeTrait.SPARSE | EdgeTrait.COMPRESSED,
898
+ "BVGraph full WebGraph with Elias coding and reference lists",
899
+ ["web crawls", "social networks", "billion-edge graphs", "graph archives"],
900
+ "100-1000x compression with fast decompression",
901
+ "very low",
902
+ {"add_edge": "O(1) batch", "neighbors": "O(degree)", "compression": "100-1000x"}
903
+ ),
904
+
905
+ EdgeMode.HNSW: StrategyMetadata(
906
+ EdgeMode.HNSW,
907
+ EdgeTrait.SPARSE | EdgeTrait.MULTI,
908
+ "Hierarchical Navigable Small World for ANN search",
909
+ ["vector search", "embeddings", "recommendations", "semantic search", "image retrieval"],
910
+ "O(log n) approximate nearest neighbor search",
911
+ "high",
912
+ {"insert": "O(M log n)", "search_knn": "O(ef log n)", "recall": ">95%"}
913
+ ),
914
+
915
+ EdgeMode.EULER_TOUR: StrategyMetadata(
916
+ EdgeMode.EULER_TOUR,
917
+ EdgeTrait.DIRECTED | EdgeTrait.SPARSE,
918
+ "Euler tour trees for dynamic forest connectivity",
919
+ ["dynamic networks", "MST with changes", "network reliability", "forest decomposition"],
920
+ "O(log n) link/cut operations for dynamic connectivity",
921
+ "medium",
922
+ {"link": "O(log n)", "cut": "O(log n)", "connected": "O(log n)"}
923
+ ),
924
+
925
+ EdgeMode.LINK_CUT: StrategyMetadata(
926
+ EdgeMode.LINK_CUT,
927
+ EdgeTrait.DIRECTED | EdgeTrait.SPARSE,
928
+ "Link-cut trees with path queries and aggregates",
929
+ ["dynamic MST", "network flows", "path aggregates", "dynamic matching"],
930
+ "O(log n) amortized for link/cut/path operations",
931
+ "medium",
932
+ {"link": "O(log n)", "cut": "O(log n)", "path_sum": "O(log n)"}
933
+ ),
934
+
935
+ EdgeMode.HOP2_LABELS: StrategyMetadata(
936
+ EdgeMode.HOP2_LABELS,
937
+ EdgeTrait.SPARSE | EdgeTrait.WEIGHTED,
938
+ "2-hop labeling for constant-time reachability queries",
939
+ ["road networks", "social graphs", "navigation", "read-heavy workloads"],
940
+ "O(1) to O(log n) reachability after O(n²m) preprocessing",
941
+ "medium",
942
+ {"reachability": "O(|L(u)| + |L(v)|)", "distance": "O(|L(u)| × |L(v)|)"}
943
+ ),
944
+
945
+ EdgeMode.GRAPHBLAS: StrategyMetadata(
946
+ EdgeMode.GRAPHBLAS,
947
+ EdgeTrait.SPARSE | EdgeTrait.DENSE | EdgeTrait.WEIGHTED,
948
+ "GraphBLAS semiring-based matrix operations",
949
+ ["graph analytics", "linear algebra", "GPU acceleration", "algorithm composition"],
950
+ "Express graph algorithms as matrix ops, enable hardware acceleration",
951
+ "medium",
952
+ {"mxm": "O(nnz(A) + nnz(B))", "element_wise": "O(nnz)"}
953
+ ),
954
+
955
+ EdgeMode.ROARING_ADJ: StrategyMetadata(
956
+ EdgeMode.ROARING_ADJ,
957
+ EdgeTrait.SPARSE | EdgeTrait.COMPRESSED,
958
+ "Roaring bitmap per-vertex adjacency for fast set operations",
959
+ ["BFS/DFS", "frontier operations", "graph traversals", "label propagation"],
960
+ "Ultra-fast frontier unions/intersections in microseconds",
961
+ "low",
962
+ {"add_edge": "O(1)", "has_edge": "O(1)", "union": "O(min(n1, n2))"}
963
+ ),
964
+
965
+ EdgeMode.MULTIPLEX: StrategyMetadata(
966
+ EdgeMode.MULTIPLEX,
967
+ EdgeTrait.MULTI | EdgeTrait.DIRECTED,
968
+ "Multi-layer graphs with per-layer semantics",
969
+ ["social networks", "transportation", "multi-relationship", "communication networks"],
970
+ "Natural modeling of multiple relationship types",
971
+ "high",
972
+ {"add_edge": "O(1)", "neighbors_layer": "O(degree)", "cross_layer": "O(L × degree)"}
973
+ ),
974
+
975
+ EdgeMode.BITEMPORAL: StrategyMetadata(
976
+ EdgeMode.BITEMPORAL,
977
+ EdgeTrait.TEMPORAL | EdgeTrait.DIRECTED,
978
+ "Bitemporal edges with valid-time and transaction-time",
979
+ ["financial systems", "compliance", "audit trails", "healthcare", "time-travel queries"],
980
+ "Complete audit trail with as-of queries and corrections",
981
+ "very high",
982
+ {"add_edge": "O(1)", "as_of_query": "O(n)", "temporal_query": "O(log n + k)"}
983
+ ),
730
984
  }
731
985
 
732
986