{"id":29192423,"url":"https://github.com/analiaburgosdev/java_greedy_compatible-activities","last_synced_at":"2025-07-02T01:31:08.117Z","repository":{"id":284643249,"uuid":"955606766","full_name":"analiaBurgosDev/java_greedy_Compatible-Activities","owner":"analiaBurgosDev","description":"Given a set of **n** activities that require exclusive use of a resource (such as a conference room), each with a start time **cᵢ** and an end time **fᵢ**, the goal is to select the maximum number of non-overlapping activities. ","archived":false,"fork":false,"pushed_at":"2025-03-26T22:58:07.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T23:41:37.121Z","etag":null,"topics":["greedy-algorithms","java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/analiaBurgosDev.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":"2025-03-26T22:55:04.000Z","updated_at":"2025-03-31T21:44:53.000Z","dependencies_parsed_at":"2025-03-26T23:42:52.481Z","dependency_job_id":null,"html_url":"https://github.com/analiaBurgosDev/java_greedy_Compatible-Activities","commit_stats":null,"previous_names":["ayvero/java_greedy_compatible-activities","analiaburgosdev/java_greedy_compatible-activities"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/analiaBurgosDev/java_greedy_Compatible-Activities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analiaBurgosDev%2Fjava_greedy_Compatible-Activities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analiaBurgosDev%2Fjava_greedy_Compatible-Activities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analiaBurgosDev%2Fjava_greedy_Compatible-Activities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analiaBurgosDev%2Fjava_greedy_Compatible-Activities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analiaBurgosDev","download_url":"https://codeload.github.com/analiaBurgosDev/java_greedy_Compatible-Activities/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analiaBurgosDev%2Fjava_greedy_Compatible-Activities/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263059545,"owners_count":23407378,"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":["greedy-algorithms","java"],"created_at":"2025-07-02T01:30:44.263Z","updated_at":"2025-07-02T01:31:08.083Z","avatar_url":"https://github.com/analiaBurgosDev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Maximizar el Número de Actividades Compatibles\n\n## Descripción del Problema\nDado un conjunto de **n** actividades que requieren el uso exclusivo de un recurso (como una sala de conferencias), cada una con un tiempo de inicio **cᵢ** y un tiempo de finalización **fᵢ**, el objetivo es seleccionar la mayor cantidad de actividades compatibles. \n\nDos actividades **i** y **j** son compatibles si sus intervalos **[cᵢ, fᵢ)** y **[cⱼ, fⱼ)** no se superponen, es decir, si **cᵢ ≥ fⱼ** o **cⱼ ≥ fᵢ**.\n\n## Enfoque\n- **Algoritmo Greedy (Codicioso)**: La estrategia óptima consiste en seleccionar siempre la actividad que termine más temprano, permitiendo así la inclusión de la mayor cantidad posible de actividades posteriores.\n- **Ordenamiento**: Se ordenan las actividades en función de su tiempo de finalización (**fᵢ**) y luego se seleccionan iterativamente según las condiciones de compatibilidad.\n\n## Aplicaciones\nEste problema es útil en diversas áreas:\n- **Planificación y Asignación de Recursos**: Gestión de salas de reuniones, planificación de producción y programación de tareas.\n- **Sistemas Operativos**: Planificación de procesos y asignación de tiempo de CPU.\n- **Gestión de Eventos**: Optimización de horarios de reuniones y planificación de agendas.\n\n----------------------------------------\n\n# Maximizing the Number of Compatible Activities\n\n## Problem Description\nGiven a set of **n** activities that require exclusive use of a resource (such as a conference room), each with a start time **cᵢ** and an end time **fᵢ**, the goal is to select the maximum number of non-overlapping activities. \n\nTwo activities **i** and **j** are compatible if their intervals **[cᵢ, fᵢ)** and **[cⱼ, fⱼ)** do not overlap, meaning **cᵢ ≥ fⱼ** or **cⱼ ≥ fᵢ**.\n\n## Approach\n- **Greedy Algorithm**: The optimal approach is to always select the activity that finishes the earliest, ensuring the maximum number of subsequent activities can fit.\n- **Sorting**: The activities are sorted in ascending order by their end time (**fᵢ**), and then iteratively selected based on compatibility conditions.\n\n## Applications\nThis problem is widely used in:\n- **Scheduling and Resource Allocation**: Conference room management, task scheduling, and production planning.\n- **Operating Systems**: Process scheduling and CPU time allocation.\n- **Event Management**: Optimizing meeting times and agenda planning.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaliaburgosdev%2Fjava_greedy_compatible-activities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanaliaburgosdev%2Fjava_greedy_compatible-activities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaliaburgosdev%2Fjava_greedy_compatible-activities/lists"}