A historical Java application for loading actor filmographies and exploring the collaboration network created by shared film appearances. Starting from an IMDb-style text file, the program builds actor-to-film, film-to-cast and actor-to-colleague relationships, then lets the user query whether two performers are connected, inspect a route between them and experiment with network metrics.
The project combines object-oriented modelling, hash-based indexing, graph traversal, custom data structures, Swing interaction and sampling-based analysis in a single academic application.
Important
This repository preserves legacy coursework originally developed in 2013 and published here in 2016. It targets Java 7 and Eclipse, contains known limitations and has not been modernised or validated for production use. See Historical status before running or reusing the code.
- Loads actors and filmographies from a legacy IMDb-style text dataset.
- Maintains searchable catalogues of actors and films using
HashMap. - Builds each film's cast while associating every actor with their films.
- Derives an actor collaboration graph from shared appearances.
- Lists an actor's films and direct collaborators.
- Checks whether two actors belong to the same connected component.
- Calculates a relationship distance and reconstructs an intermediate route.
- Estimates the average degree of separation through random sampling.
- Experiments with degree-based and path-based centrality measures.
- Adds actors and films interactively, sorts actors by name and exports catalogue data.
flowchart TD
D["IMDb-style dataset"]
C["Actor and film catalogues"]
G["Collaboration graph"]
Q["Relationship queries"]
M["Sampled network metrics"]
D --> C
C --> G
G --> Q
G --> M
The graph is represented implicitly:
- Vertex: an actor or actress.
- Edge: two performers appear in the same film.
- Path: a chain of shared-film collaborations.
- Relationship distance: the number of collaboration steps reported between two performers.
Actor stores a filmography and a collection of colleagues, while Pelicula stores its cast. Loading the input therefore creates both sides of the domain relationship and the edges needed for graph exploration.
Running lab3.Main opens a Swing-based menu with the following operations:
| Option | Operation | Output |
|---|---|---|
| 1 | Load a filmography file | Populates actor, film, cast and colleague collections |
| 2 | Add an actor | Creates an actor and optionally associates films |
| 3 | Add a film | Adds a film to the global catalogue |
| 4 | Sort actors | Prints actors alphabetically |
| 5 | Save data | Writes the catalogue using a legacy hard-coded path |
| 6 | Inspect an actor | Prints the actor's films and direct colleagues |
| 7 | Measure relationship distance | Prints the reported number of collaboration steps |
| 8 | Check connectivity | Prints whether a route exists |
| 9 | Show a relationship route | Prints the intermediate actors |
| 10 | Estimate average separation | Uses repeated random samples |
| 11 | Show a degree-based Top 10 | Experimental implementation |
| 12 | Estimate a central actor | Experimental path-sampling implementation |
| 13 | Exit | Closes the menu loop |
The dialogs collect user input, while most detailed results and timing information are written to the console.
.
├── src/
│ ├── lab3/
│ │ ├── Actor.java
│ │ ├── Pelicula.java
│ │ ├── ListaActores*.java
│ │ ├── ListaPeliculas*.java
│ │ ├── Cola.java
│ │ ├── Pila.java
│ │ ├── Main.java
│ │ └── Prueba*.java
│ └── otrasmovidas/
│ └── Grafo.java
├── actresses-small-ok.txt
├── colegas.txt
├── bin/
└── .classpath / .project
| Component | Responsibility |
|---|---|
Main |
Swing menu, parsing, persistence, relationship searches and graph metrics |
Actor |
Performer identity, filmography, direct colleagues and traversal state |
Pelicula |
Film title and cast membership |
ListaActoresPrincipal |
Global actor index keyed by name |
ListaPeliculasPrincipal |
Global film index keyed by title |
ListaActores / ListaPeliculas |
Relationship-specific hash-based collections |
Cola |
Custom fixed-capacity FIFO structure |
Pila |
Custom fixed-capacity LIFO structure and route reconstruction |
StopWatch |
Basic elapsed-time measurement |
Prueba* |
Standalone test and demonstration programs |
Grafo |
Unfinished generic adjacency-matrix experiment |
| Structure or technique | Purpose | Intended characteristic |
|---|---|---|
HashMap<String, Actor> |
Actor lookup by name | Average O(1) lookup and insertion |
HashMap<String, Pelicula> |
Film lookup by title | Average O(1) lookup and insertion |
| Actor colleague maps | Implicit adjacency lists | Direct access to neighbouring vertices |
Custom Cola<T> |
FIFO exploration | Fixed-capacity circular queue |
Custom Pila<T> |
LIFO exploration and path reversal | Fixed-capacity stack |
| Bubble sort | Alphabetical actor output | O(n²) time |
| Random pair sampling | Approximate global metrics | Exchanges exactness for lower cost |
The relationship methods store traversal depth and predecessor information temporarily in each Actor, then attempt to restore that state after the search.
- A Java Development Kit.
- A graphical desktop environment for Swing.
- Eclipse IDE if you want to reproduce the original project configuration.
The checked-in Eclipse classpath targets JavaSE-1.7. The source uses no external runtime dependencies, but compilation and behaviour on a current JDK have not been verified.
-
Clone the repository:
git clone https://github.com/jagumiel/Administrador_Actores.git cd Administrador_Actores -
In Eclipse, select File -> Import -> Existing Projects into Workspace.
-
Select the cloned directory.
-
Configure an appropriate JDK if Eclipse cannot resolve the original Java 7 execution environment.
-
Run
src/lab3/Main.javaas a Java application. -
Choose option
1and openactresses-small-ok.txt.
Note
The Eclipse project metadata uses the internal project name EDA; this reflects the coursework from which the standalone repository was extracted.
The legacy sources contain ISO-8859-1 text. A direct compilation attempt can therefore use:
mkdir -p out
find src -name '*.java' -print0 \
| xargs -0 javac -encoding ISO-8859-1 -d out
java -cp out lab3.MainThe application requires a graphical session. The command-line build above is provided as a starting point and is not currently covered by CI.
actresses-small-ok.txt is a compact fixture in the format expected by the parser: an actor appears on the first line of a record, followed by additional tab-indented film entries. It is suitable for exploring the interface and the included relationship cases; it is not the complete historical IMDb dataset.
colegas.txt records expected direct colleague relationships for part of the sample.
The repository contains executable test programs rather than one automated test suite:
PruebaColaandPruebasColaexercise fixed-capacity queue behaviour.PruebaEstanRelacionadoscovers connectivity, reported distances and intermediate routes.PruebaGradoRelacionesexercises the sampled separation metric.PraandPruebascontain small development experiments.
Several test entry points reference absolute paths from the original development machines. They must be adapted before they can run elsewhere. There is no Maven or Gradle build, JUnit suite or continuous-integration workflow.
This repository is best understood as an educational snapshot, not as a current graph-analysis library. Important limitations include:
- The Eclipse metadata targets Java 7.
- Source files retain a legacy character encoding.
- Saving and several test programs use machine-specific absolute Windows paths.
- The relationship frontier in
Mainis a LIFOPila, although the operation is described as a minimum-distance search. A stack-based traversal does not generally guarantee the shortest path; a breadth-first queue is required for that guarantee. - Traversal state is stored in mutable
Actorobjects, which makes cleanup essential and complicates repeated or concurrent searches. - The Top 10 and sampled-centrality paths are experimental and retain implementation notes and iterator issues.
- Random sampling is unseeded, so results are not reproducible.
Grafo.RecorridoEnAnchura()is unfinished; the active relationship algorithms live inMain.- Compiled
.classfiles and Eclipse artefacts are committed underbin/. - The current
.gitignorecovers operating-system files but not Java/Eclipse build output. - No repository-wide licence is currently declared.
These constraints are useful evidence of the project's evolution and provide concrete opportunities for refactoring.
Administrador_Actores is a standalone snapshot derived from a broader series of progressive Data Structures and Algorithms laboratories. It contains the collaboration-graph model associated with Lab 3 and later path and centrality experiments associated with Lab 4, while retaining the Java package name lab3.
The complete progression, original reports and surrounding exercises are available in jagumiel/EDA:
hash-based catalogue
↓
custom linked structures
↓
actor collaboration graph
↓
paths and sampled centrality
Use this repository when you want to inspect the actor-network application as a compact standalone project. Use EDA when you want the full pedagogical sequence and its design documentation.
- Preserve the current implementation under a
legacytag or branch. - Convert every source and data file to UTF-8.
- Add a Maven or Gradle build and remove generated binaries from version control.
- Replace absolute paths with file choosers, command-line arguments or configurable paths.
- Separate parsing, domain modelling, graph analysis, persistence and user interface into distinct packages.
- Represent traversal state locally with maps and sets instead of mutating
Actor. - Implement shortest-path search with
ArrayDequeas a FIFO queue. - Return a typed result containing connectivity, distance, actors and shared films.
- Replace bubble sort and custom fixed-size containers where the exercise no longer requires them.
- Add JUnit 5 tests for direct links, disconnected components, cycles, self-comparison and competing path lengths.
- Make sampling reproducible with a configurable random seed.
- Replace the experimental centrality code with documented degree, closeness or betweenness calculations.
- Add CI for builds, tests and static analysis on a supported LTS JDK.
- Agree on and add a licence that reflects the collaborative origin of the work.
This application originates from collaborative coursework developed by:
The standalone GitHub repository was published by Jose Ángel Gumiel. The full collaborative context and reports are preserved in EDA.
No repository-wide licence is currently provided. Copyright therefore remains with the authors, and reuse or redistribution may require their permission.