Skip to contents

Discovers all promotion paths from one job title to another within a specified maximum number of steps. Uses breadth-first search to find paths efficiently.

Usage

find_career_paths(
  edges,
  from,
  to,
  max_depth = 5,
  sector = NULL,
  ignore_case = TRUE,
  top_n = 10
)

Arguments

edges

A tibble of promotion edges (from `load_validated_promotions("edges", ...)` or `load_unvalidated_promotions("edges", ...)`).

from

Character string specifying the starting job title.

to

Character string specifying the target job title.

max_depth

Integer specifying the maximum path length to search. Default is 5.

sector

Optional character string to filter edges by sector.

ignore_case

Logical; if TRUE (default), performs case-insensitive title matching.

top_n

Integer specifying the maximum number of paths to return. Default is 10. Set to NULL to return all paths found.

Value

A list containing:

paths

A list of character vectors, each representing a path from `from` to `to`.

summary

A tibble summarizing each path with length and edge details.

from

The matched starting title.

to

The matched target title.

n_paths

Number of paths found.

Details

The function searches for all possible promotion paths between two job titles in the career transition network. Paths are ordered by length (shortest first).

Title matching is fuzzy by default - if an exact match isn't found, the function will attempt to find the closest matching title.

Examples

if (FALSE) { # \dontrun{
edges <- load_validated_promotions("edges", "~/cmap_data/promotions/validated")

# Find paths from analyst to director
paths <- find_career_paths(edges, from = "analyst", to = "director")

# Filter by sector
paths <- find_career_paths(edges, from = "software engineer",
                           to = "cto", sector = "information_technology")
} # }