{"id":18792363,"url":"https://github.com/kplanisphere/multilist-graph-operations","last_synced_at":"2025-08-20T11:21:37.830Z","repository":{"id":241967720,"uuid":"808335438","full_name":"KPlanisphere/multilist-graph-operations","owner":"KPlanisphere","description":"Proyecto 5 - Estructuras de Datos","archived":false,"fork":false,"pushed_at":"2024-05-30T21:21:53.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T15:26:03.944Z","etag":null,"topics":["adjacency-list","algorithm-implementation","breadth-first-search","cpp","data-structures","depth-first-search","graph-operations","graph-theory","multilist"],"latest_commit_sha":null,"homepage":"https://linktr.ee/planisphere.kgz","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KPlanisphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-30T21:19:42.000Z","updated_at":"2024-05-30T21:29:26.000Z","dependencies_parsed_at":"2024-05-30T23:56:57.452Z","dependency_job_id":"37146ead-4359-43e7-a6de-d22a51a4ff9c","html_url":"https://github.com/KPlanisphere/multilist-graph-operations","commit_stats":null,"previous_names":["kplanisphere/multilist-graph-operations"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fmultilist-graph-operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fmultilist-graph-operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fmultilist-graph-operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KPlanisphere%2Fmultilist-graph-operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KPlanisphere","download_url":"https://codeload.github.com/KPlanisphere/multilist-graph-operations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718371,"owners_count":19685725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adjacency-list","algorithm-implementation","breadth-first-search","cpp","data-structures","depth-first-search","graph-operations","graph-theory","multilist"],"created_at":"2024-11-07T21:19:38.005Z","updated_at":"2025-02-19T19:14:16.661Z","avatar_url":"https://github.com/KPlanisphere.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multilist Graph Operations\n\nThis project implements a multilayer graph structure in C++ with various operations to manipulate and traverse the graph. The program includes functions to insert nodes and edges, display the graph, perform breadth-first and depth-first searches, and an option for Kruskal's algorithm (not implemented yet). It also features a menu-driven interface for user interaction.\n\n## Features\n\n- **Insert Node**: Adds a new node to the graph.\n- **Insert Edge**: Adds an edge between two nodes.\n- **Display Graph**: Prints the adjacency list of the graph.\n- **Breadth-First Search (BFS)**: Traverses the graph using BFS starting from a specified node.\n- **Depth-First Search (DFS)**: Traverses the graph using DFS starting from a specified node.\n- **Menu Interface**: Provides a user-friendly menu to perform the above operations.\n- **Placeholder for Kruskal's Algorithm**: An option for Kruskal's algorithm, to be implemented.\n\n## Usage\n\nCompile the program using a C++ compiler and run the executable. You will be presented with a menu to choose from various operations.\n\n### Example Commands\n\n1. **Insert Node**: Prompts the user to enter a value for the new node.\n2. **Insert Edge**: Prompts the user to enter the start and end nodes for the edge.\n3. **Display Graph**: Displays the adjacency list of the graph.\n4. **Breadth-First Search**: Prompts the user to enter the starting node for BFS.\n5. **Depth-First Search**: Prompts the user to enter the starting node for DFS.\n6. **Kruskal's Algorithm**: Placeholder for future implementation.\n7. **Exit**: Terminates the program.\n\n## Code Snippets\n\n### Insert Node\n```cpp\nvoid insertarNodo() {\n    Nodo aux, new_nodo = new struct nodo;\n    cout \u003c\u003c \"\\n VALOR DEL NODO: \";\n    cin \u003e\u003e new_nodo-\u003einfo;\n    new_nodo-\u003esig = NULL;\n    new_nodo-\u003eady = NULL;\n    new_nodo-\u003evisitado = false;\n\n    if (head == NULL) {\n        head = new_nodo;\n    } else {\n        aux = head;\n        while (aux-\u003esig != NULL) {\n            aux = aux-\u003esig;\n        }\n        aux-\u003esig = new_nodo;\n    }\n    totalnodos++;\n}\n```\n\n### Insert Edge\n```cpp\nvoid agregarArista(Nodo\u0026 aux, Nodo\u0026 aux2, Arista\u0026 nuevo) {\n    Arista saveNoditos;\n    if (aux-\u003eady == NULL) {\n        aux-\u003eady = nuevo;\n        nuevo-\u003edestino = aux2;\n    } else {\n        saveNoditos = aux-\u003eady;\n        while (saveNoditos-\u003esig != NULL) {\n            saveNoditos = saveNoditos-\u003esig;\n        }\n        nuevo-\u003edestino = aux2;\n        saveNoditos-\u003esig = nuevo;\n    }\n    cout \u003c\u003c \"\\n [!] UNION AGREGADA CORRECTAMENTE [!]\";\n}\n```\n\n### Breadth-First Search\n\n```cpp\nvoid RecorridoAncho(char raiz) {\n    queue\u003cNodo\u003e cola;\n    Nodo aux, x, y;\n    Arista aux2, ndito = NULL;\n    aux = head;\n    clearCola(cola);\n    clearTrueVisit(aux);\n\n    while (aux != NULL) {\n        if (aux-\u003einfo == raiz) {\n            break;\n        }\n        aux = aux-\u003esig;\n    }\n    y = head;\n    aux-\u003evisitado = true;\n    cola.push(aux);\n    cout \u003c\u003c \"\\n BFS: \";\n\n    while (!cola.empty()) {\n        x = cola.front();\n        aux2 = x-\u003eady;\n        cout \u003c\u003c x-\u003einfo \u003c\u003c \"  \";\n        cola.pop();\n\n        while (x-\u003eady != NULL) {\n            ndito = x-\u003eady;\n            while (ndito != NULL) {\n                while (y != NULL) {\n                    if (y-\u003einfo == ndito-\u003edestino-\u003einfo) {\n                        if (y-\u003evisitado == false) {\n                            y-\u003evisitado = true;\n                            cola.push(y);\n                        }\n                    }\n                    y = y-\u003esig;\n                }\n                ndito = ndito-\u003esig;\n                y = head;\n            }\n            x-\u003eady = x-\u003eady-\u003esig;\n        }\n        x-\u003eady = aux2;\n    }\n}\n```\n\n### Menu Interface\n\n```cpp\nvoid menu() {\n    cout \u003c\u003c \"\\n\\t - - - - LISTA DE LISTAS - MULTILISTAS - - - -\" \u003c\u003c endl;\n    cout \u003c\u003c \"\\t\\t\\t   (+ KRUSKAN)\\n\" \u003c\u003c endl;\n\n    cout \u003c\u003c \" [1] INSERTAR UN NODO\" \u003c\u003c endl;\n    cout \u003c\u003c \" [2] INSERTAR UNA ARISTA\" \u003c\u003c endl;\n    cout \u003c\u003c \" [3] MOSTRAR  GRAFO\" \u003c\u003c endl;\n    cout \u003c\u003c \" [4] RECORRIDO A LO ANCHO\" \u003c\u003c endl;\n    cout \u003c\u003c \" [5] RECORRIDO A LO PROFUNDO\" \u003c\u003c endl;\n    cout \u003c\u003c \" [6] KRUSKAN\" \u003c\u003c endl;\n    cout \u003c\u003c \" [7] SALIR\" \u003c\u003c endl;\n\n    cout \u003c\u003c \"\\n INGRESE OPCION: \";\n}\n```\n\n## How to Run\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/KPlanisphere/multilist-graph-operations.git\n    ```\n2. Navigate to the project directory:\n    ```bash\n    cd multilist-graph-operations\n    ```\n3. Compile the code:\n    ```bash\n    g++ MLista.cpp -o multilist_graph\n    ```\n4. Run the executable:\n    ```bash\n    ./multilist_graph\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplanisphere%2Fmultilist-graph-operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkplanisphere%2Fmultilist-graph-operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplanisphere%2Fmultilist-graph-operations/lists"}