From 2f768e72aae5016a68d69ce4cee1cce2e36568fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=9A=D1=83=D0=B7=D0=B0?= =?UTF-8?q?=D1=85=D0=BC=D0=B5=D1=82=D0=BE=D0=B2?= Date: Wed, 1 Jul 2026 14:00:47 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20RE?= =?UTF-8?q?ADME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 74 ------------------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 0061aff..0000000 --- a/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Graph with Reflection Capabilities - -This project implements a simple directed graph data structure in JavaScript with built‑in reflection and introspection utilities. -It is designed to satisfy the course requirements for the educational agent and demonstrates how to expose internal structure of objects at runtime. - -## Features - -- **Nodes & Edges** – Add nodes with optional data, add directed edges with optional data. -- **Adjacency** – Retrieve neighbors, all nodes, all edges. -- **Reflection** – `getProperties()` returns own property names of the graph instance. - `getMethods()` returns all public method names defined on the prototype. -- **Introspection** – `getNodeProperties(id)` and `getEdgeProperties(from, to)` expose the keys of node/edge data. -- **Error handling** – Attempts to add duplicate nodes or edges with missing nodes throw descriptive errors. - -## Installation - -```bash -# Clone the repository -git clone -cd - -# Install dependencies -npm install -``` - -## Usage - -```js -const Graph = require('./src/index'); - -const g = new Graph(); -g.addNode('A', { value: 10 }); -g.addNode('B', { value: 20 }); -g.addEdge('A', 'B', { weight: 5 }); - -console.log(g.getNeighbors('A')); // ['B'] -console.log(g.getEdgeData('A', 'B')); // { weight: 5 } - -console.log(g.getProperties()); // ['nodes', 'edges', 'edgeData'] -console.log(g.getMethods()); // ['addNode', 'addEdge', ...] -``` - -## Running Tests - -The project uses **Jest** as the test runner. - -```bash -npm test -``` - -All tests are located in `src/index.test.js` and cover: - -- Basic graph operations (add nodes/edges, retrieval). -- Error conditions. -- Reflection methods. -- Introspection utilities. - -## Project Structure - -``` -├── src -│ ├── index.js # Graph implementation -│ └── index.test.js # Jest test suite -├── package.json # npm configuration -└── README.md # Documentation -``` - -## Contributing - -Feel free to open issues or pull requests. Please ensure that new features are accompanied by tests. - -## License - -MIT © Your Name \ No newline at end of file