How to tackle the Annual cycle?

We are experimenting with Annual cycle in our company for some workloads we have to repeat every week, month, year etc…

So far we have tried:

  • Teams calender

  • Microsoft Planner

  • Classic SharePoint Online Task list with Gantt (modern doesnt support Gantt)

  • Custom list in SharePoint Online (with some SPD and or Flow attached for the logic)

Anybody have any better suggestions we can try out inside the Microsoft umbrella? Only 2 stipulations

  1. It has to be OOTB functionality so no extra coding of any kind

  2. No 3rd party software

How to deal with parallel edges between two vertices in cycle detection using BFS in an undirected graph?

I am new to Programming and learning Algorithms and was studying BFS when I read that BFS could be used for cycle detection. I tried to implement the same on an undirected graph G with Adjacency List Representation. What I did is as follows:

• Do a simple BFS Traversal using a Queue while maintaining the parent node of nodes enqueued in the queue.

• If I come across a node u that has a neighbor v such that v is already visited but v is not the parent of u then that means there is cycle in the graph.


#adjList is the adjacency list given as a dictionary #myQueue is a double-sided queue containing node and its parent node ([Node, parNode]) #visited is a set containing visited nodes  while(myQueue):     currNode, parNode = myQueue.pop() #dequeue operation     visited.add(currNode) #Marking currNode as visited     for childNode in adjList[currNode]: #Traversing through all children of currNode         if currNode not in visited:             myQueue.appendleft([childNode, currNode]) #Enqueue operation         else:             if childNode!=parNode: #Main logic for cycle detection                 print('CYCLE DETECTED')                 break 

The above approach is working except in cases when I have more than 1 edge between 2 vertices for e.g. in following case we have 2 edges between vertices 0 and 1:

Graph containing cycle

Adjacency list of above graph is: adjList = {0:[1, 2], 1:[0], 2:[0]}. Here we can clearly see that the graph contains a cycle but above algorithm is not able to detect the same because when BFS will reach vertex 1, vertex 0 is already visited but vertex 0 is also the parent of vertex 1 so this cycle will go undetected.

My question is how I can modify above algorithm to detect such cases?

Edit: I tried the same logic on directed graphs also, and I am facing similar problem i.e. case when I have a directed edge from vertex 0 to vertex 1 and another directed edge from vertex 1 to vertex 0

cycle structure of bounded genus graphs [on hold]

Given fixed genus $ k$ is there some $ q=f(k)$ for which for any graph $ G$ of bounded genus $ k$ there are $ q$ planar subgraphs $ G_1,G_2,..,G_q$ of $ G$ such that each cycle of $ G$ can be written as the symmetric difference of cycles in $ G_i$ ?
If true what is a bound of $ f(k)$ can you use a fixed (non-planar) embedding of $ G$ such that each $ G_i$ is planar?

Also posted here: and btw which stackexchange should I uses to post graph theory type problems?

What easy algorithms are there for calculating products of cycle decompositions?

Here is the easy algorithm we are taught for adding two numbers in base-10 notation. We are taught this algorithm in first or second grade.

  sub infix:<+>(@x, @y) {    #x, y are lists of digits    #returns a list of digits    my @greater = (@y.elems > @x.elems) ?? @y !! @x;    my @lesser_ = (@y.elems > @x.elems) ?? @x !! @y;    my @gPopped = @greater;    my @lPopped = @lesser_;    my $  carry = 0;    my @sum;    loop (my $  i = 0; $  i < @greater.elems; $  i++) {      if (@lPopped.elems >= 1) {        my $  gDigit = @gPopped.tail;        my $  lDigit = @lPopped.tail;        @sum.append: (($  gDigit + $  lDigit) % 10) + $  carry;        $  carry = (($  gDigit + $  lDigit) / 10).floor;        @lPopped = @lPopped.head(@lPopped.elems - 1);        @gPopped = @gPopped.head(@gPopped.elems - 1);      } else {         my $  gDigit = @gPopped.tail;         @sum.append: $  gDigit + $  carry;         $  carry = 0;         @gPopped = @gPopped.head(@gPopped.elems - 1);      }    }    return @sum.reverse;   } 

The algorithm is very easy and a child can do it by hand. Meanwhile, I am unaware of any algorithm for multiplying two permutations decomposed into cycle form (e.g. $ (123)\times(12)(34)$ ). What is an easy algorithm for multiplying two cycles?

Bellman ford – negative cycle

This is my code for detecting a negative cycle in a graph using bellman ford algorithm but I can’t figure out why it returns a wrong answer

public static final int INF = Integer.MAX_VALUE; private static int negativeCycle(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost) {     int dep[] = new int[adj.length];     for(int i=0; i<adj.length; ++i)         dep[i] = INF;      dep[0] = 0;      for (int i = 0; i < adj.length-1; i++) {         for(int j = 0; j < adj.length; j++){             for (int v : adj[j]) {                 int v_index = adj[j].indexOf(v);                 if (dep[v] > dep[j] + cost[j].get(v_index)) {                     dep[v] = dep[j] + cost[j].get(v_index);                  }             }         }     }      for (int j = 0; j < adj.length; j++) {         for (int v : adj[j]) {             int v_index = adj[j].indexOf(v);             if (dep[v] > dep[j] + cost[j].get(v_index)) {                 return 1;             }         }     }      return 0; } 

Simple hamilton cycle reduction


  • Input: A undirected graph G and 2 nodes s, t

  • Question: Does G contain a hamilton path from s to t?


  • Input: A undirected graph G and a nodes s

  • Question: Does G contain a hamilton cycle starting at s?

I wish to show HAMCYCLE is NP-hard

I’ll show this by doing $ HAMPATH \leq_p HAMCYCLE$ since HAMPATH is known to be NP-COMPLETE

Reduction is as follows

$ (G, s, t) \to (G’, s’)$

where $ s’ = s$ and for $ G’$ I will add one edge from $ t$ to $ s’$

This is polynomial time because we are adding only an edge

if $ (G, s, t) \in HAMPATH$ , then we know there is a hamilton path from s to t, our graph G’ will be $ (s’, \dots, t)$ but since we added a edge from $ t$ to $ s’$ then

$ (s’, \dots, t, s’)$ , a cycle, thus $ (G’,s’) \in HAMCYCLE$

Now doing the converse, if $ (G’, s’) \in HAMCYCLE$ then there exist a hamilton cycle from $ (s’, …, s’)$ that visits every node and comes back to s’ meaning there is a node $ t$ right before $ s$ to make this a hamilton path, thus $ (G, s, t) \in HAMPATH$

Above is my entire attempt. I was wondering if I could call on $ t$ in my reduction since its not used as a input in HAMCYCLE ?

Determine if a graph has exactly 1 cycle using a SAT solver

I have a connected undirected graph whose edges are either enabled or disabled. I want to create a set of clauses that are SAT iff all enabled edges are part of a single loop.

If I assert that each vertex has either 0 or 2 enabled edges, then graphs where all enabled edges are part of a single loop will satisfy the clauses. However, graphs with multiple disjoint loops can will also satisfy those clauses. How can I make sure that only 1 loop graphs satisfy the clauses?

Is there a way to cycle through levels of a filter and generate outputs in R?

I am trying to generate report card outputs using R, but have over 200 agents (levels in my factor) that require their own report (tibble output that I can write to .csv or html).

I have included a reproducible example below.

library(tidyverse) Agents <- c("A", "B", "C") Month <- c("May", "June", "July") Score1 <- c(5,7,1) Score2 <- c(7,8,3)  df <- cbind(Agents, Month, Score1, Score2) df2 <-  df2$  Score1 <- as.numeric(as.character(df2$  Score1)) df2$  Score2 <- as.numeric(as.character(df2$  Score2))  Report <- df2 %>%             group_by(Month) %>%            summarise(Skill = mean(Score1), Attitude = mean(Score2)) 

I would like to loop through my agents, using each as a filter on the Report, and then save it as Report_agentname. I took a look at purr but can’t quite get my head around the map function and my needs here.

Vicious cycle: No DPKG & No space left on device

Ubuntu 18.04.02 LTS on GCP

df -i Filesystem      Inodes  IUsed   IFree IUse% Mounted on /dev/root      3870720 158973 3711747    5% / devtmpfs       1923380    387 1922993    1% /dev tmpfs          1924177      1 1924176    1% /dev/shm tmpfs          1924177    554 1923623    1% /run tmpfs          1924177      8 1924169    1% /run/lock tmpfs          1924177     18 1924159    1% /sys/fs/cgroup /dev/loop0       12823  12823       0  100% /snap/core/7270 /dev/loop1       23213  23213       0  100% /snap/google-cloud-sdk/86 /dev/loop2       12820  12820       0  100% /snap/core/6964 /dev/sda15           0      0       0     - /boot/efi /dev/loop3       23074  23074       0  100% /snap/google-cloud-sdk/88 tmpfs          1924177     10 1924167    1% /run/user/1001 

Trying to do anything with the boot partition, such as

ls -l >>>... >>>cannot copy extracted data for './usr/lib/file/magic.mgc' to '/usr/lib/file/magic.mgc. dpkg-new': failed to write (No space left on device) 

Broken partition

sudo apt-get remove  linux-headers-4.15.0-1036-gcp    >>>E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct th e problem.  

Same when trying

sudo apt remove p7zip-full 

No space to fix the broken partition !

sudo dpkg --configure >>>dpkg: error: failed to write status database record about 'libstdc++6:amd64' to '/var/l ib/dpkg/status': No space left on device$