Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FJSP with arbitrary precedence graphs #11

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The FJSPLIB format is as follows:
<num jobs> <num machines> <avg num machines per operation>
<num operations> * (<num machines> * (<machine idx> <duration>))
...

<OPERATION_PRECEDENCE_SECTION>
<node 1> <node 2>
<node 3> <node 4>
...
```

The first line contains data about the number of jobs, number machines and average number of machines that can process an operation.
Expand Down
12 changes: 6 additions & 6 deletions fjsplib/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ def parse_job_line(line: list[int]) -> list[ProcessingData]:
return operations


def compute_precedences(jobs: list[list[ProcessingData]]) -> list[Arc]:
def classic_precedences(jobs: list[list[ProcessingData]]) -> list[Arc]:
"""
Computes precedence relationships based on the job data.

In the classic FJSP, it is assumed that operations are processed in
sequence of their appearance in the job data.
Computes precedence relationships according to the classic FJSP definition,
where operations are processed in the order they appear in the job data.
"""
precedences: list[Arc] = []
idx = 0
Expand Down Expand Up @@ -77,9 +75,11 @@ def read(loc: Path) -> Instance:
# represents a job and its operations.
jobs = [parse_job_line(line) for line in lines[1:]]

# TODO Identify "OPERATION_PRECEDENCE_DATA" and parse accordingly.

# The remaining data can be computed from the job data.
num_operations = len([op for operations in jobs for op in operations])
precedences = compute_precedences(jobs)
precedences = classic_precedences(jobs)

return Instance(
num_jobs,
Expand Down
Loading