int checkmanyroads(int city1)
{
int i = 0;
int min = 0;
for (int j = 0; j < grapharray.GetLength(1); j++)
{
if ((j > city1) && (checkrouttocity(city1, j)))
{
i++;
manycities += j + ";";
}
}
if (i > 1)
{
manycitiesar = manycities.Split(';');
min = grapharray[city1, Convert.ToInt32(manycitiesar[0])];
for (int j = 0; j < i; j++)
{
if (grapharray[city1, Convert.ToInt32(manycitiesar[j])] < min)
min = Convert.ToInt32(manycitiesar[j]);
}
}
else
{
manycitiesar = manycities.Split(';');
min = Convert.ToInt32(manycitiesar[0]);
}
return min;
}