Skip to main content

read_problem

Function read_problem 

Source
pub fn read_problem<T: DeserializeOwned, P: AsRef<Path>>(
    path: P,
    format: FileFormat,
) -> Result<T>
Expand description

Read a problem from a file.

§Arguments

  • path - The file path to read from
  • format - The file format to use

§Example

use problemreductions::io::{read_problem, FileFormat};
use problemreductions::models::graph::MaximumIndependentSet;
use problemreductions::topology::SimpleGraph;

let problem: MaximumIndependentSet<SimpleGraph, i32> = read_problem("problem.json", FileFormat::Json).unwrap();