Error with shortest path function in R

0 votes

I'm facing some issues with shortest.path function.

shortest.paths(g, v=2795, to=2839) # correct

         [,1]
    [1,] 3930.4

get.shortest.paths(g, from=2795, to=2839) # warning and no results

    [[1]]

    numeric(0)

Warning message:
In get.shortest.paths(g_novy, from = 2795, to = 2839) :
  At structural_properties.c:5296 :Couldn't reach some vertices
Nov 12, 2018 in Data Analytics by Ali
• 11,360 points
1,726 views

1 answer to this question.

0 votes

you have a directed graph. The shortest.paths function will tell you the length of the shortest undirected path. The get.shortest.paths function tells you that there is no directed path between the vertices.

answered Nov 12, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
4,556 views
+1 vote
1 answer
0 votes
1 answer

": cannot open the connection" Error in R

There can be two reasons for this ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
5,070 views
+2 votes
1 answer

“subscript out of bounds” Error in r programming

This error is likely to occur when ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
9,563 views
+1 vote
1 answer

What does “replacement has” Error mean?

This error occurs when one tries to ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
690 views
0 votes
1 answer

Errors saying "Error: unexpected '}' in "}"

This is a syntax error: Enclose your if ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,840 points
3,122 views
0 votes
1 answer

Error saying "Error in rnorm() : argument "n" is missing, with no default" in R

Hey @ali, rnorm() function requires an argument, ...READ MORE

answered Oct 30, 2018 in Data Analytics by Maverick
• 10,840 points
3,332 views
0 votes
1 answer

Error sayimg "Executing test function test.should_error ... Timing stopped at: 0 0 0 " in R

In your testthat tests you declare an anonymous function like so: function() ...READ MORE

answered Nov 12, 2018 in Data Analytics by Maverick
• 10,840 points
1,009 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP