zrwusa / data-structure-typed

Javascript Data Structure & TypeScript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree, AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack.
https://data-structure-typed-docs.vercel.app
MIT License
98 stars 7 forks source link

Feature Request: Hypergraphs #60

Open FlorianWendelborn opened 7 months ago

FlorianWendelborn commented 7 months ago

Is your feature request related to a problem? Please describe.

Right now there doesn’t seem to be any implementation of a hypergraph on NPM. It would be great if it was as easy to work with hypergraphs as it is with ordinary graphs.

image

Hypergraphs can be useful for various problems. In my specific case, I’m interested in computing all valid combinations of a list of possible actions a player could take where each action has n inputs and n outputs. (E.g. input: 100 coins + 1 sword, output: 1 upgraded sword; real interactions are more complicated, and potentially cyclic)

Describe the solution you'd like

Describe alternatives you've considered

N/a

Additional context

Wikipedia: Hypergraph

Also, thank you for making this project. It seems well tested and feature complete and TypeScript needs more libraries like this.

zrwusa commented 7 months ago

Thank you for your sincere advice. I think we can incorporate Hypergraph into our planning.