using MATALB solve Graph-Theory mathematical problems