Resource Ranking
Resource ranking allows you to express preferences for which resources should handle specific jobs on a scale from 1 to 100, where lower values indicate stronger preferences. Unlike tags that match resources by characteristics, rankings directly specify which named resources are preferred for each job.
When to Use Rankings
Rankings are ideal when you want to:
- Prefer senior technicians for complex jobs without making it mandatory
- Indicate customer preferences for specific resources
- Balance skill levels across assignments
- Express graduated preferences rather than binary (yes/no) constraints
Basic Ranking Example
In this example, we have electrical jobs that can be handled by different resources. The rankings express our preference for specific resources by name, where lower ranking values mean higher preference.
In this request:
- The
electrical
tag is a hard constraint - only resources with this tag can be assigned Senior-Tech-1
has a ranking of 10, expressing the strongest preferenceJunior-Tech-1
has a ranking of 70, indicating it’s acceptable but not preferred- Rankings reference specific resource names, not tags
- The
rankingWeight
in options controls how important rankings are relative to other objectives
Combining Rankings with Other Constraints
Rankings work alongside other VRP constraints. Here’s an example combining rankings with time windows and priorities:
Understanding Ranking Scores
The solver penalizes assignments based on ranking values. Lower ranking values (closer to 1) indicate stronger preferences and result in better scores.
For example, with rankingWeight: 10
:
- Ranking 1 → Most preferred (minimal penalty)
- Ranking 10 → Strongly preferred
- Ranking 50 → Moderately preferred
- Ranking 100 → Least preferred (maximum penalty)
The penalty increases with higher ranking values, encouraging the solver to use resources with lower ranking numbers.
Best Practices
- Use rankings for preferences, not requirements: If a resource must have certain qualifications, use hard tags instead
- Scale rankings meaningfully: Reserve 1-10 for strong preferences, 11-50 for moderate preferences, and 51-100 for acceptable but not preferred options
- Adjust rankingWeight: Higher weights make rankings more important relative to travel time and other objectives
- Combine with soft tags: You can use both soft tags (weight-based) and rankings for nuanced preferences
- Default behavior: Resources without a matching ranked tag are treated as having the lowest preference (equivalent to rank 100)