Dataflow Diagram - What is U? - erd

I assume P is Primary, F is Foreign, but I also notice U.
What does U stand for and what does it do?
I can't seem to find anything after googling.

Related

Controlling the 'levels' of differentiation in SageMath 9.1

Sage seems to want to evaluate derivatives as far as possible using the chain rule. A simple example is:
var('theta')
f = function('f')(theta)
g = function('g')(theta)
h = f*g
diff(h,theta)
which would display
g(theta)*diff(f(theta), theta) + f(theta)*diff(g(theta), theta)
My question is, is there a way to control just how far Sage will take derivatives? In the example above for instance, how would I get Sage to display instead:
diff(f(theta)*g(theta))
I'm working through some pretty intensive derivations in fluid mechanics, and being able to not evaluate derivatives all the way like discussed above would really help with this. Thanks in advance. Would appreciate any help on this.
This would be called "holding" the derivative.
Adding this possibility to Sage has already been considered.
Progress on this is tracked at:
Sage Trac ticket 24861
and the ticket even links to a branch with code implementing this.
Although progress on this is stalled, and the branch has not been merged,
you could use the code from the branch.

Can someone explain this little code snippet for me?

I'm working on a project where I'm referencing a Maths textbook which makes use of SageMath, they've given this as a proof. I'm not well-versed in SageMath so I'm having trouble properly understand what the code is doing. Could someone explain it to me?
The theorem it's meant to be proving is the following:
"For the Hungarian Rings
puzzle every permutation of the 38 pieces is possible. In other words, HR = S38."
sage: S38=SymmetricGroup(38)
sage: L=S38("(1,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2)")
sage: R=S38(" (1,38,37,36,35,6,34,33,32,31,30,29,28,27,26,25,24,23,22,21)")
sage: HR=S38.subgroup([L,R])
sage: HR==SymmetricGroup(38)
True
Annotation, though I don't know this puzzle. Perhaps it's in David Joyner's Adventures in Group Theory?
sage: S38=SymmetricGroup(38)
This is the symmetric group of all permutations of some set of 38 objects. I hope there are 38 things in the puzzle somehow.
sage: L=S38("(1,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2)")
sage: R=S38(" (1,38,37,36,35,6,34,33,32,31,30,29,28,27,26,25,24,23,22,21)")
These are two very specific permutations of the 38 objects. Note that not all of them are permuted in each element. Looks like between the two of them all of them are shifted by one element in either direction. Maybe some objects go in a circle, and the others also do. Only one element in common.
sage: HR=S38.subgroup([L,R])
This is the subset (and hence subgroup) of permutations generated by doing these two ones again and again and again ...
sage: HR==SymmetricGroup(38)
True
Apparently every permutation of the 38 elements - shuttling the various objects around without reference to the actual puzzle, as if you took it completely apart - are actually achievable by just doing the two actions L and R again and again in SOME order!
That is actually pretty cool. Now I want to find out about and play this puzzle.

Modified Shortest Path Algorithm (Dijkstra's)

So my problem is that I have a directed graph G with non-negative edge lengths and I wish to find the shortest path between two nodes u and v such that they only pass through one marked node in the graph.
If we did not have the condition involving the marked nodes this problem could easily be solved using Dijkstra's algorithm.
procedure dijkstra(G, l, s)
Input: Graph G = (V, E), directed or undirected;
positive edge lengths {le : e ∈ E}; vertex s ∈ V
Output: For all vertices u reachable from s, dist(u) is set to the distance from s to u.
for all u ∈ V :
dist(u) = ∞
prev(u) = nil
dist(s) = 0
H = makequeue(V ) (using dist-values as keys)
while H is not empty:
u = deletemin(H)
for all edges (u, v) ∈ E:
if dist(v) > dist(u) + l(u, v):
dist(v) = dist(u) + l(u, v)
prev(v) = u
decreasekey(H, v)
Additionally, to handle the condition I was considering adding a value which gave the current number of nodes in the current best path from s to u (this would be updated whenever dist(u) was updated). But this doesn't seem to work since the algorithm is not keeping track of all possible paths that we've seen with one or less nodes , but rather just the lowest distance path.
My question is am I on the right track and just need to modify the algorithm additonally? Or is there another algorithm that would accomplish this easier?
Also, this is for a homework problem so please do not post an entire solution, I'm just looking for guidance.
As you don't want the entire solution, I will give you some hints. Stop reading each paragraph and then try to solve the problem, I'll try to go from more general hints to more specific ones.
First, I don't think your current idea can solve the problem. So I will try to guide you to a different approach. It is a good idea to think of Dijkstra, but instead of modifying Dijkstra, consider transforming the graph so to achieve that running Dijkstra in your new graph solves the original problem.
How to remove the original restriction of the set P? Well, it is important that the graph is directed (or at least for my idea). Think of a way of transforming the graph so as to force that if you enter one node of P, you cannot enter another one of P again.
Last idea, without still giving the solution. Consider replicating the graph, maybe deleting some edges and connecting the nodes from the two copies in some way.

Solving an extension of the Shortest Hamiltonian Path

I was thinking about an extension to the Shortest Hamiltonian Path (SHP) problem, and I couldn't find a way of solving it. I know it is NP-complete, but I figured I'd ask here for ideas, since I do not want to simply brute force the problem.
The extension is fairly simply: Given an undirected, complete, weighted graph with n vertices, find the shortest hamiltonian path with end vertices v and u.
So, bruteforce would still take O(n!) time, since the remaining n-2 vertices can be visited in (n-2)! ways. I was trying to find a way to maybe solve this slightly faster. My efforts for finding a way to solve this problem in a beneficial manner has so far been fruitless.
Would anyone have an idea how to exploit the knowledge of the end-vertices? Preferably explained alongside some pseudocode. It is required for the solution found to be optimal.
I guess it could be solved by integer programming, since the knowledge of end nodes are fairly limiting, and makes it easy to avoid cycles, but it wouldn't really exploit the composition of the problem.
If you want to find the shortest path to connect all nodes, then you should look at travelling salesman algorithms. I don't exactly see why you approach it as an HSP. The only reason I can think of is that you want to specify your starting cities, but it should be easy to fix that (if you need that I can post it) by changing your graph a bit.
edit: adding how to tweak your graph
Add 1 node (call it E) and only connect it to your starting and ending nodes. A TSP will compute a solution to your problem by connecting all your nodes. As E is only reachable by going from start to E and then to end, the solution (a cycle yes) will contain start - E - end. Then you remove the 2 edges to and from E and you have the optimal solution. Within the TSP, the path from start to end will be optimal.
You can use a metaheuristic algorithm. There are many kinds of them (Local search, constructive search, etc.). One of them could be based on:
For each x belonging to the set of vertices X:
- Find the set of closest vertices to x C.
- Filter the set C in order to include one of them in the path P.
Repeat until all vertices of X have been included in the path P.
End.

What is a "graph carving"?

I've faved a question here, and the most promising answer to-date implies "graph carvings". Problem is, I have no clue what it is (neither does the OP, apparently), and it sounds very promising and interesting for several uses. My Googlefu failed me on this topic, as I found no useful/free resource talking about them.
Can someone please tell me what is a 'graph carving', how I can make one for a graph, and how I can determine what makes a certain carving better suited for a task than another?
Please don't go too mathematical on me (or be ready to answer more questions): I understand what's a graph, what's a node and what's a vertex, I manage with big O notation, but I have no real maths background.
I think the answer given in the linked question is a little loose with terminology. I think it is describing a tree carving of a graph G. This is still not particularly google-friendly, I admit, but perhaps it will get you going on your way. The main application of this structure appears to be in one particular DFS algorithm, described in these two papers.
A possibly more clear description of the same algorithm may appear in this book.
I'm not sure stepping through this algorithm would be particularly helpful. It is a reasonably complex algorithm and the explanation would probably just parrot those given in the papers I linked. I can't claim to understand it very well myself. Perhaps the most fruitful approach would be to look at the common elements of those three links, and post specific questions about parts you don't understand.
Q1:
what is a 'graph carving'
There are two types of graph carving: Tree-Carving and Carving.
A tree-carving of a graph is a partition of the vertex set V into subsets V1,V2,...,Vk with the following properties. Each subset constitutes a node of a tree T. For every vertex v in Vj, all the neighbors of v in G belong either to Vj itself, or to Vi where Vi is adjacent to Vj in the tree T.
A carving of a graph is a partitioning of the vertex set V into a collection of subsets V1,V2,...Vk with the following properties. Each subset constitutes a node of a rooted tree T. Each non-leaf node Vj of T has a special vertex denoted by g(Vj) that belongs to p(Vj). For every vertex v in Vi, all the neighbors of v that are in ancestor sets of Vi belong to either
Vi or
Vj, where Vj is the parent of Vi in the tree T, or
Vl, where Vl is the grandparent in the tree T. In this case, however the neighbor of v can only be g(p(Vi))
Those defination referred from chapter 6 of book "Approximation Algorithms for NP-Hard problems" and paper1. (paper1 is picked from Gain's answer, thanks Gain.)
According to my understanding. Tree-Carving or Carving are a kind of representation (or a simplification) of an original graph G. So that the resulting new graph still preserve 'connection properties' of G, but with much smaller size(less vertex, less nodes). These two methods both somehow try to delete 'local' 'similar' information but to keep 'structure' 'vital' information. By merging some 'closed' vertices into one vertex and deleting some edges.
And It seems that Tree Carving is a little bit simpler and easier to understand Since in **Carving**, edges are allowed to go to a single vertex in the grapdhparenet node as well. It would preserve more information.
Q2:
how I can make one for a graph
I only know how to get a tree-carving.
You can refer the algorithm from paper1.
It's a Depth-First-Search based algorithm.
Do DFS, before return from an iteration, check whether this edges is 'bridge' edge or not. If yes, you need remove this 'bridge' and adding some 'back edge'.
You would get a DFS-partition which yields a tree-carving of G.
Q3:
how I can determine what makes a certain carving better suited for a task than another?
Sorry I don't know. I am also a new guy in graph theory.
If you have more question:
What's g function of g(Vj)?
a special node called gray node. go to paper1
What's p function of p(Vj)?
I am not sure. maybe p represent 'parent'. go to paper1
What's the back edge of node t?
some edge(u,v) s.t. u is a decent of t and v is a precedent of t. goto to paper1
What's bridge?
bridge wiki

Resources