pub fn write_problem<T: Serialize, P: AsRef<Path>>(
problem: &T,
path: P,
format: FileFormat,
) -> Result<()>Expand description
Write a problem to a file.
§Arguments
problem- The problem to writepath- The file path to write toformat- The file format to use
§Example
use problemreductions::io::{write_problem, FileFormat};
use problemreductions::models::graph::IndependentSet;
let problem = IndependentSet::<i32>::new(3, vec![(0, 1), (1, 2)]);
write_problem(&problem, "problem.json", FileFormat::Json).unwrap();