cycle Questions

1

I'm trying to find cycles of length 2, 3, 4, and 5 in a directed graph. So far I've had decent luck on most inputs using the simple_cycles algorithm from networkx (https://networkx.readthedocs.io/e...
Introspection asked 1/5, 2016 at 2:35

11

Solved

I am solving a problem on directed acyclic graph. But I am having trouble testing my code on some directed acyclic graphs. The test graphs should be large, and (obviously) acyclic. I tried a lo...
Kianakiang asked 8/10, 2012 at 22:26

7

Hey I have an application where I want to now when the APP goes to onPause or onDestroy because I want to call a certain function when this happens. I tried to override the onPause in an activity a...
Engaged asked 3/3, 2017 at 10:13

3

I want to count total number of directed cycles available in a directed graph (Only count is required). You can assume graph is given as adjacency matrix. I know DFS but could not make a workin...
Unesco asked 27/10, 2015 at 14:49

10

I had a look at question already which talk about algorithm to find loop in a linked list. I have read Floyd's cycle-finding algorithm solution, mentioned at lot of places that we have to take two ...

5

Solved

I have directed graph with lot of cycles, probably strongly connected, and I need to get a minimal cycle from it. I mean I need to get cycle, which is the shortest cycle in graph, and every edge is...
Hewart asked 1/3, 2010 at 21:7

1

Solved

I have a music note datatype defined like so: data Note = Ab | A | Bb | B | C | Db | D | Eb | E | F | Gb | G deriving (Eq, Ord) How can i make it an instace of Enum so that succ G returns Ab ?
Indeterminable asked 9/1, 2022 at 14:24

4

Solved

I understand that in order to detect a cycle in a linked list I can use the Hare and Tortoise approach, which holds 2 pointers (slow and fast ones). However, after reading in wiki and other resourc...

4

Solved

I need some help, when I use svg to draw a cycle and put some text, how to Center Text inside an SVG Path <svg height="500"width="500"> <path d="M250 250 L250 0 A250,250,0,0,1,250,...
Hagans asked 1/7, 2017 at 11:21

22

Solved

I understand that Tortoise and Hare's meeting concludes the existence of a loop, but how does moving tortoise to the beginning of linked list while keeping the hare at the meeting place, followed b...
Record asked 29/5, 2010 at 18:47

11

I need a working algorithm for finding all simple cycles in an undirected graph. I know the cost can be exponential and the problem is NP-complete, but I am going to use it in a small graph (up to ...
Ultravirus asked 11/9, 2012 at 10:34

2

Using the SPFA algorithm below in a directed graph with negative and positive weights, how can we detect negative cycles? procedure Shortest-Path-Faster-Algorithm(G, s) 1 for each vertex v ≠ s ...
Schwarz asked 2/8, 2013 at 2:52

3

Solved

How do I cycle through an iterator a finite number of times? I would expect the output of something like this to be 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 and then stop: vec![1, 2, 3].iter().cycle(4)...
Gendarmerie asked 19/12, 2019 at 16:31

2

Solved

Suppose I have a list like this: my_list = [A, B, C, D, E, F, G] Actually, I use my list like a cycle. This means that after G there is A, and before A, there is G. I want to know what is the s...
Agrology asked 27/6, 2015 at 21:7

7

Solved

Say I have a list: l = [1, 2, 3, 4] And I want to cycle through it. Normally, it would do something like this, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2... I want to be able to start at a certain point in...
Brosy asked 20/1, 2012 at 11:30

7

So, I have a simple task, given the array: let arr = [true, false, true, false, true]; I need to reverse true to false and visa versa. I have managed to do this with a for loop: And it works fine....
Triboluminescent asked 16/9, 2019 at 11:48

11

I am working with complex networks. I want to find group of nodes which forms a cycle of 3 nodes (or triangles) in a given graph. As my graph contains about million edges, using a simple iterative ...
Snuck asked 10/11, 2009 at 5:33

1

Solved

I have directed igraph and want to fetch all the cycles. girth function works but only returns the smallest cycle. Is there a way in R to fetch all the cycles in a graph of length greater then 3 (n...
Mirisola asked 10/3, 2019 at 19:21

5

I have a hw problem that asks for an algorithm that detects if there is any cycle in any undirected graph that contains any given edge 'E'. The algorithm should run in O(N) linear time. The proble...
Sybyl asked 11/10, 2011 at 23:29

2

What is the best way to detect for cycles in a graph of a considerable size using cypher. I have a graph which has about 250000 nodes and about 270000 relationship and I would like to detect cycles...
Kym asked 12/4, 2013 at 0:51

3

Solved

list1 = [1,2,3,4] If I have list1 as shown above, the index of the last value is 3, but is there a way that if I say list1[4], it would become list1[0]?
Swinford asked 2/3, 2018 at 2:10

1

Solved

When I try to optimize my code, for a very long time I've just been using a rule of thumb that addition and subtraction are worth 1, multiplication and division are worth 3, squaring is worth 3 (I ...
Manzoni asked 30/9, 2017 at 18:30

6

Solved

I've got problem with jQuery.cycle plugin. At first load of page (when imgs aren't cached) it's showing small imgs, like thumbnails. You can see it at (edit: sorry, old link) - just wait when the s...
Gratian asked 17/1, 2010 at 22:6

4

Solved

Given two arrays, how do you check if one is a cyclic permutation of the other? For example, given a = [1, 2, 3, 1, 5], b = [3, 1, 5, 1, 2], and c = [2, 1, 3, 1, 5] we have that a and b are cyclic...
Traveler asked 24/5, 2011 at 2:19

1

In relational database design, should one worry about one (or more) "cyclic graphs" posing problems? (Simplified) E.g., tables T1(T1_Id, ...) T2(T2_Id, T1_Id_Fk, ...) T3(T1_Id_Fk, T2_Id_Fk, ..) ...

© 2022 - 2025 — McMap. All rights reserved.