If u take a tour of MATLAB groups you`ll most probably find some'C' export tool that converts your m-files to c-files. whether or not the generated code has the optimum performance is source of discussion.
for this special example, you might also look 4 3rd party graphic processing/rendering libraries(boost::gli,Qt,mapserver,gdal...).
on second thought, you can set up an output hash table that collects all connected points under the same hash. then use the flood-fill algorithm to paint the spots; ie. gather points under hash values in the table and remove painted points from input container. this way beginning of the input container always contains the next first unpainted point.
My maths is quite poor and I need some help writing an algorithm/pseudo for a simple cost estimator:
I have three inputs x, y and z. The inputs each have a separate max value that if breached return an error. These max values, X = 20, Y = 15, Z = 30.
Now I need a function that compares the in-putted values and if possible swaps the values to keep them under the constraints. Also,
Z should always contain the smallest value as long as the swapped value still meets the max value constraints.
So for a few examples if the user entered X=15,Y=5,Z=10 the values for y and Z would be swapped to make z the lowest value. With X=5 Y=18 Z=2 X and Y would be swapped with x to fit under max values. With X=10 Y=8 Z=2 nothing would be swapped. X=31 Y=18 Z=10 nothing would be swapped and you would get an error.
I had to solve a specific problem for a client, this problem take some time to come with a original solution, that is working.
What i would like to know is if my solution is a original solution, if it fits as an algorithm or more like a recipe (since is very specific to this problem), and also if it is an original algorithm where should I publish it.
Thanks in avance for your answers.
Now the problem:
I Work with business process management, a common issue in BPM is who to define who does which tasks and how to implement a rule based on the responsabilities and role of the user.
In this case an aproval depend on the CEO (the one that must do the task). However he can delegate the task (everytime or in vacation) to the CFO and Manager A.
Also the Manager A delegates to both the Assistant Manager 1 (AM1) and Assistant Manager 2 (AM2), and the CFO delegates to Finantial Manager A (FMA) and Finantial Manager B (FMB).
So a process may be aproved by any of these groups:
- CFO and Manager A
- CFO and AM1 and AM2
- FMA and AM1 and AM2
- FMB and AM1 and AM2
- FMA and Manager A
- FMB and Manager B
(Assume CEO - Level 1, CFO - Level 2, Manager A - Level 2, The others - Level 3)
We seen that someone in level 2 can aprove with someone in level 3 of another branch.
However it gets tricky since AM1 (level 3) can delegate its on tasks on CFO (level 2 of the other branch)
So this line
- CFO and AM1 and AM2
turns into 2 lines:
- CFO and AM1 and AM2
- CFO and CFO and AM2 (because CFO only aproves once so it become: - CFO and AM2)
This seems hard, but belive i am not give all the requirements, the real problem as some issues more, but the main question is the one I explained above.
I will give the solution, maybe write an article where. However first i want to know if it already exists, or something similar. But google for task delegation returns results obviously nothing to do with this problem.
After your tip i did some research and i think my solution fits more or less in Direct Acyclic Graph more than oriented graph.
Oriented is a direct translation from French, the right translation is Directed
Glad you found what you were looking for.
- If you consider my answer useful, you can up vote it (green arrow when the mouse is on left at beginning of answer).
- If you think the problem solved, change the tittle of your question and add Answered or Solved
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
1. first one, with next characteristics: circular area of view, speed, drag coefficient;
2. wind (or water current, doesn't matter; some sort of resistance) with some strength and direction;
3. polygon, concave (in general case).
I need to build path of first object inside this polygon, which will:
1. cover whole polygon by view area;
2. be optimal by travel time;
3. takes into account wind direction and strength.
In other words, I need to carry out exploration in a given area on optimal trajectory while scout can be drift away.
My question, actually, is: what algorithms should I use to build this trajectory?.. I know, that maybe this is strange. I investigate this problem last few days and already have some sort of solution. I just want to find some people who might solve this task earlier.
I just want to find some people who might solve this task earlier.
The thing has a location, a direction (vector, some arrow) and a speed (velocity in them expensive manuals)
Once you have those three things in an oject, you can introduce "forces" like gravity.
Do keep in mind that you are asking for something rather complex; there is a huge difference in resistance between wind and water, also depending on the shape of the object it hits, any currents that form due to that shape, any contaminations and other stuff. Other stuff like temperatures of below 0 where water does not tend to flow
Start out with something fun one can easily play with; have a ball bounce on the screen and change the gravity to be equal to the moon. Once you have one force, introducing a new one should not be hard.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
and every value represent something and I have some attributes in the database that corresponds to these values. Now what I need to do is I need to search the records from database on the bases of above mentioned array. Kindly suggest me an algorithm that would do something like this. I need something like machine learning that would be able to do this thing with flexibility. What I have found from my research that following algorithm is closer to what I am looking for:
There's no specific math subject that would be more important than others for algorithms in general. The most important skill for developing or understanding algorithms is logical thinking and the ability to break a problem into smaller parts. Unless, of course, if you're going to deal with algorithms for a specific problem domain in particular - like graphics or sound processing - then certain math subjects will certainly be more helpful than others.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson