Advance Graph Algorithm

Hello guys,
I am working now on a TSP(traveling salesman problem), I am facing a very challenging problem in fact.
The Main Problem: I need to find all the possible routes from A to B, I believed that there is no algorithm to provide such thing after a deadly search, so If anyone can help with just a link or a similar algorithm that would be great.
And if you are interested to know why I need such algorithm;
1 - I need to have the TSP works on only a part of a big graph, like a big city and I work the TSP only on 4 places.
2 - So I need to make a small Graph object for the only 4 places, and pass it to TSP.
3 - I need to make sure that all edges of this graph are set to the shortest paths between every pair of places. But if I found out that this shortest path go through a place which is in the TSP problem, then I have to find another(thats why i need the all routes algorithm).
4 - (which is the main problem) this short path can't pass through any place which is within the TSP problem(coz TSP go through every place only once).
(ex if the TSP is interested in places A, B, C, D and the shortest path from A to B passes through D, I can't pass this small graph object to TSP until I find another path connecting A to B and doesn't pass through C nor D -if there is no such path then of course I have to set it with infinity-).
I hope one of you guys worked on this problem before,
Thanks & Regrads,
ES_Coders

Thanks all,
I have already solved the problem. I will declare it again here.
TSP: is to find a cycle that goes through every node only once and goes back to the start point.
MySystem: consists of nodes from A, B, C, ...., Z.
Main Idea: user chooses a number of nodes to find their TSP.
Ex: User wants to find TSP around A, B, C only.
Problem: if the shortest path (A to B ) go through another node N, and also shortest path(B, C)go through this very same node N. Then the cycle goes through the node N twice which makes the TSP fail.
Solution:
1- Use special type of Floyed(or Dijkstra) which finds the shortest paths between every pair of nodes (n1, n2) (n1, n3) ... . But the special part is that this Floyed method takes an array of the nodes considered by TSP lets say{t1, t2, ...}. And it finds the shortest path between (n1, n2) except that this shortest path doesn't go through any of {t1, t2, t3, ...}.
2- Now when I apply TSP lets say for {A, B, C} I am sure that shortest path from (A to B) doesn't go through node C, but It can go through some other node n which doesn't belong to {A, B, C} -some other node in the system-
3- After I get my answer from TSP, if i found that this TSP doesn't pass through any place more than once, this is cool, I did it. But if it does pass through the node n more than once. (Here is the trick) I apply TSP for {A, B, C, n} by this way I ll start again whit the special Floyed making sure that every shortest path doesn't pass through n. And when I go for the real TSP the node n won't be passed through twice.
I hope I was able to declare the problem and the solution,
Thx a lot guys,
ES_Coders

Similar Messages

  • Graph algorithm question

    Hello.
    I am trying to find a graph algorithm (by graph I mean nodes interconnected to each other,not the sketch of a function).This algorithm should yield the route that passes from as many nodes of the graph as possible,though it is forbidden to step on a node twice,and then ends back to the first node that it started from,thus forming a cycle.
    I am positive that this algorithm must have been researched by now,so in order to avoid thinking it myself I wonder if someone would know to direct me somewhere in the web where I can get it.Since I am a medical student,any terminology help would be also appreciated(as to the name of what I want,keywords to search etc).

    OK. Before you get too geeky here, try a brute force approach. if your graph is small or has limited connectivity, you may not need to get fancy. Its surprising what a computer can do without breaking a sweat. In any case I whipped up a solution as shown below. It is untested and will most likely have bugs (and does not check for null conditions). But as you can see the code is pretty basic and should get you from point A to point B (pun inteneded).     public List<Integer> getLargestCycle( Map<Integer,List<Integer>>graph )
            List<Integer> longestCycle = new Vector<Integer>();
            List<Integer> path = new Vector<Integer>();
            for ( Integer startingPoint : graph.keySet() )
                path.add(startingPoint);
                List<Integer> aCycle = getLargestCycle( graph, path );
                if ( aCycle.size() > longestCycle.size() )
                    longestCycle = aCycle;           
            return longestCycle;
        protected List<Integer> getLargestCycle( Map<Integer,List<Integer>>graph,
            List<Integer> currentPath )
            List<Integer> longestCycle = new Vector<Integer>();
            Integer currentPoint = currentPath.get( currentPath.size()-1 );
            Integer startingPoint = currentPath.get( 0 );
            for ( Integer nextPoint : graph.get( currentPoint ) )
                List<Integer> aPath = new Vector( currentPath );
                aPath.add( nextPoint );
                if ( nextPoint.equals( startingPoint ) )
                    if ( longestCycle.size() == 0 )
                        longestCycle = aPath;
                else if ( currentPath.contains( nextPoint ) )
                    // not a cycle here.
                else
                    List<Integer> aCycle = getLargestCycle( graph, aPath );
                    if ( aCycle.size() > longestCycle.size() )
                        longestCycle = aCycle;
            return longestCycle;
        }

  • Advanced Graphs option seems missing in JDeveloper 11G

    I am trying to do an exercise on "Data Visualization and Graphs in JSF". (http://www.oracle.com/technology/products/jdev/viewlets/11/)
    I have created a query on a table and am trying build a graph based on this query. When I try to build a graph in JDeveloper 11.1.1.2.0 - build 5536; I do not get the 'Advanced graphs' option under 'Data Visualization - Graphs components.
    I am not sure whether there is an update or jar file missing. I will really appreciate if somebody could point me to how to enable this option.
    Thanks,
    Daar.

    I wanted to share the following answer with those who might be looking for the same. I got this from one of the gurus in this field.
    "The dvt:graph tab is not shown as part of the component palette - but you can manually use it by adding it in your code editor.
    See documentation here:
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e12418/tagdoc/dvt_graph.html"

  • Jdev 11g: Advanced graph no longer supported?

    Hi,
    I can't find and select advanced graph type from ADF Data Visualization. Is this type not supported for production release (TP's had this type and even release notes suggest to use dvt:graph).
    regards
    Peter

    Hi all,
    The How To is a little out of date, sorry about that. I will publish an updated version soon.
    The recommended way is to create a line graph, and then add a time selector tag (like Peter pointed out).
    However, since in the dvt:lineGraph there is no attribute for the time selector listener, you need to add the listener in the backing bean.
    Here are the code snippets:
    In jspx:
    <dvt:lineGraph id="master"
    value="#{bindings.master1Graph.graphModel}"
    style="Comet"
    imageFormat="FLASH" imageWidth="400"
    binding="#{sampleGraph.richTimeSelectorMasterGraph}"
    animationOnDisplay="AUTO"
    imageHeight="250">
    <dvt:legendArea rendered="false"/>
    <dvt:timeSelector explicitStart="#{sampleGraph.startDate}" explicitEnd="#{sampleGraph.endDate}" fillColor="#33FFFFFF" borderColor="#313675" mode="EXPLICIT" />
    <dvt:seriesSet defaultMarkerType="MT_CURVE_LINE">
    <dvt:series id="0" color="#FDB026"/>
    </dvt:seriesSet>
    </dvt:lineGraph>
    In the backing bean:
    public UIGraph getRichTimeSelectorMasterGraph()
    if (m_richTimeSelectorMasterGraph == null)
    m_richTimeSelectorMasterGraph = new UIGraph();
    m_richTimeSelectorMasterGraph.addTimeSelectorListener(this);
    return m_richTimeSelectorMasterGraph;
    public void setRichTimeSelectorMasterGraph(UIGraph graph)
    m_richTimeSelectorMasterGraph = graph;
    Hope this helps
    Katia
    Edited by: Katarina Obradovic-Sarkic on Oct 29, 2008 10:39 AM

  • Dual graph algorithm

    Hello to all of you!
    Does anyone know a known algorithm to create the dual graph of a planar (undirected) graph? Or could you give me a hint? I tried to devise a DFS approach, which would use the back and cross edges of the DFS tree in order to form the faces. The problem is that I need the set of disjoint minimum cycles. Thus I would need an algorithm to calculate the difference AUB - A^B, for two cycles A,B, where B is a part of A. By the way, is there any recommended representation of a face?
    Thank you in advance and thaks for your time!
    P.S. For those who would ask what is a face, a face is the area defined by a minimum cycle e.g.:
    In this mesh (ignore dots):
    a-b-c
    I . I . I
    d-e-f
    a,b,c,d form a face
    b,c,e,f form a face
    and there is also the external face -which by the way how can it be defined?
    P.S.2 the Dual Graph is the graph formed by representing each face as a node and each edge which separates two faces, as an edge between the two newlly created nodes.

    OK , guess you're right! Since the following graph:
    O     O
    |\   /|
    | \ / |
    |  O  |
    | / \ |
    |/   \|
    O     O
    and this one
    O---
    |    \
    | O  |
    | | \|
    | |  O
    | | /|
    | O  |
    |   /
    O---are the same, however they have a different embedding AND dual graph.
    So, the embedding is defined by the coordinates of the nodes, along with
    their connectivity info.
    This means that for a start I need an algorithm to return the different faces of
    the graph. (at least these ones have to be fixed in number -no?). Then from
    the topological information for each face I should check their neighboring
    relations.
    For the face discovery I have thought of the following algorithm (in language):
    Create the DFS tree
    -Start from the root r of the DFS tree and visit each neighboring node based
    on the preordering number
    -When we reach a node b which has one or more back-edges we have a
    cycle.
    --For each back edge we go back to the node bs, starting from the
    back-edge which leads us to the node bs with the greatest start time
    (gretest preorder number).
    --from this node, bs, visit neighboring nodes, again based on preordering,
    until we find the node b (which will complete the cycle)
    ---While going towards b follow in reverse direction, each backedge that
    terminates a currntly visited node, and starts from a node t whose
    preorder[t] <= preorder[b]  (to avoid bypassing b by going deeper in the tree)
    and
    postorder[t] > postorder[b] (to avoid reaching another branch)
    -When we reach a node, cs,which has a cross edge to another node, ce, of
    the DFS tree (as a cross edge I mean a (u,v) where pre[u]>pre[v] and
    post[u]>post[v]) we have found another cycle, thus a face
    --from ce we go up the DFS, i.e., in reverse preordering, until we find a node
    a whose postorder[a] > post[cs]
    --from a we go down the DFS (in preordering) choosing the neighbor, an,
    whose postorder[an] >= postorder[cs] (equality means we have found cs
    thus we're done).  While descending we follow the same rules as before, in
    the case of the back edge.Of course the implementation of this algorithms has to support two-way movement in the DFS tree. The distinction between tree,back and cross edges is made through the pre and post ordering.
    I'm not sure but i think that, with the restrictions I have put, this algorithm can be ran while discovering and creating the DFS tree, rather after the DFS tree has been fully created.
    So if the algorithm IS correct, I only need a way to derive the connectivity between the produced faces via their topological information. That is, apart from the indisputable fact that if two faces have two nodes in common, they are neighbors, we have to locate all other edges between faces.
    One idea is for each pair of faces to check their min and max, X and Y coordinates. I have a sense that for faces f1and f2 where,
    f1_max_X > f2_max_X and
    f1_min_X < f2_min_X and
    f1_max_Y > f2_max_Y and
    f1_min_Y < f2_min_Y
    (there must be at most one equality (i.e. <=)but I guess its no harm to add all equalities there)
    holds, f1 and f2 are neighbors, thus an edge (f1,f2) must exist in the dual graph.
    Of course I have written a lot but I really would like to know if there's a "good" algortihm to create faces out there and a technique to create edges between faces given the coordinates.
    I propose the ideas in case someone finds something wrong and reports it or otherwise someone else finds my answer useful in the same topic.
    Thank you in advance!
    Message was edited by:
    M.M.

  • Graph algorithm concerning colors

    Hi, all.
    Suppose we have a rectangle of width w and height h, which has w*h square grids. At any time each grid can either be empty or be occupied by a colored square. Whenever l squares in a series (horizontal, vertical or diagonal) have the same color, we call them "connected". Note l here is a variable. So I need an algorithm to find out all such connected squares.
    I think it is a question in the graph theory field. Anyone got a hint or an idea for me? Many thanks.

    But I'm still not so clear about how to resolve my
    problem. Suppose BFS is used, do you mean I should
    start at any vertex and search for adjacent vertex
    that has the same color with the current one, and
    iterate like this? If so, I have to apply this
    procedure on each occupied grid. Did I go right? If
    not, could you be more specific?Let's say this is a Grid which exists of a List of Cells.
    [y]
    5 (o)-(o)-(o)-(o)-(o)
        |   |   |   |   |
    4 (o)-(o)-(x)-(o)-(o)
        |   |   |   |   |
    3 (o)-(x)-(x)-(x)-(o)
        |   |   |   |   |
    2 (o)-(o)-(x)-(o)-(o)
        |   |   |   |   |
    1 (x)-(x)-(x)-(x)-(o)
        1   2   3   4   5 [x]A Cell has (at least) the following methods:
    - left(), returns the Cell on the left side of this Cell (or null if x = 1)
    - right(), returns the Cell on the right side of this Cell
    - up(), ...
    - down(), ...
    Say we want to examine all connected Cells with the x-color, starting at (1,1),
    add that first Cell in a List and perform a BFS on the Grid:
    List<Cell> connected = new ArrayList<Cell>();
    connected.add(Grid.getCell(1, 1));
    BFS(connected);A BFS would look a bit like this:
    void BFS(List<Cell> visited) {
      // Get the last Cell in the List
      Cell last = visited.get(visited.size()-1);
      // Get all connected Cells
      Cell left = last.left();
      Cell right = ...
      // If the left Cell is not null, if it's the same color
      // as the last node, and if it's not already in your visited-
      // list: add it and perform a BFS on the new visited-list.
      if(left != null && last.color.equals(left.color) &&
         !visited.contains(left)) {
        visited.add(left);
        BFS(visited);
    }Hope it's of help to you.
    Good luck.

  • Can I implement advanced control algorithm with floating-point computations in Ni 7831R ?

    Hi,
    I plan to use a Ni 7831R to control a MIMO nano-positioning stage with servo rate above 20kHz. The control algorithm is based on robust control design and it is much more complex than PID. it also includes floating-point caculations. Can I implement such algorithm with Ni 7831R?
    By the way, is there any way to expand the FPGA gates number for Ni 7831R? Suppose I run out of the FPGA gates (1M), can I add more FPGA gates by buying some different hardware?
    Thanks
    Jingyan
    Message Edited by Jingyan on 08-22-2006 01:45 PM

    Jingyan,
    as long as there is no GPU core implemented on the FPGA these devices only support integer arithmetic. NI's FPGA targets currently don't contain a GPU core so there is no native floating point arithmetic available.
    Still there are several options to implement floating point arithmetic on your own or to work around this target specific limitation. Here are some links that might help:
    Floating-Point Addition in LabVIEW FPGA
    Multiplying, Dividing and Scaling in LabVIEW FPGA
    The NI 7831R uses an 1M FPGA. If your application requires more gates the NI 7833R (3M) is a good solution.
    I hope that helps,
    Jochen Klier
    National Instruments Germany

  • Advance Graph dvt:timeSelector

    Hi All,
    I was trying following sample example to create Time Selector graph but whenever I am running the Graph the "timeselector window" is not coming on my graph. While checking the warnings on JSPX page I found the message that "Setting the timeselector mode to explicit is not supported in ScreenReader mode".
    Any help please?
    http://www.oracle.com/technology/products/jdev/11/how-tos/dvt_how_tos/adf_dvt_graph_howto.html
    My source code-
    <dvt:graph id="graph11" value="#{bindings.Master1.graphModel}"
    binding="#{backing_sampleGraph.graph11}"
    graphType="LINE_VERT_ABS" stylePath="Comet"
    imageFormat="FLASH"
    timeSelectorListener="#{backing_sampleGraph.processTimeSelector}">
    <dvt:timeSelector mode="EXPLICIT"
    explicitStart="#{sampleGraph.startDate}"
    explicitEnd="#{sampleGraph.endDate}"
    borderColor="#313675" fillColor="#33FFFF"/>
    <dvt:legendArea position="LAP_BOTTOM"/>
    <dvt:seriesSet defaultMarkerType="MT_CURVE_LINE">
    <dvt:series id="A0" color="#FDB026"/>
    </dvt:seriesSet>
    </dvt:graph>

    Hi Katia,
    Thank you for looking in to the issue. I have only one backing bean backing_SampleGraph with class name "SampleGraph". The code is as given below. I am using SRDEMO schema and I have added explicit order by in the the query and I think Dates are in regular intervals. I am sending you screen shot in email.
    THANKS
    Chetan
    Backing Bean -
    package oracle.samplegraph.view.backing;
    import java.sql.SQLException;
    import java.util.Date;
    import javax.faces.event.AbortProcessingException;
    import oracle.adf.view.faces.bi.component.graph.UIGraph;
    import oracle.adf.view.faces.bi.event.TimeSelectorEvent;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.input.RichInputDate;
    import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import oracle.adf.view.rich.component.rich.output.RichMessages;
    import oracle.binding.BindingContainer;
    import oracle.jbo.uicli.binding.JUCtrlActionBinding;
    import oracle.jbo.uicli.binding.JUCtrlAttrsBinding;
    public class SampleGraph {
    private RichForm form1;
    private RichDocument document1;
    private RichMessages messages1;
    private UIGraph master;
    private UIGraph pieGraph1;
    private BindingContainer bindings;
    private Date StartDate;
    private Date EndDate;
    private RichPanelFormLayout panelFormLayout1;
    private RichInputDate inputDate1;
    private RichInputDate inputDate2;
    private RichCommandButton commandButton1;
    public void setBindings(BindingContainer bindings) {
    this.bindings = bindings;
    public BindingContainer getBindings() {
    return bindings;
    public void setForm1(RichForm form1) {
    this.form1 = form1;
    public RichForm getForm1() {
    return form1;
    public void setDocument1(RichDocument document1) {
    this.document1 = document1;
    public RichDocument getDocument1() {
    return document1;
    public void setMessages1(RichMessages messages1) {
    this.messages1 = messages1;
    public RichMessages getMessages1() {
    return messages1;
    public void setMaster(UIGraph graph1) {
    this.master = graph1;
    public UIGraph getMaster() {
    return master;
    public void setPieGraph1(UIGraph pieGraph1) {
    this.pieGraph1 = pieGraph1;
    public UIGraph getPieGraph1() {
    return pieGraph1;
    public void processTimeSelector(TimeSelectorEvent event) throws AbortProcessingException {
    Date sdate = new Date(event.getStartTime());
    Date edate = new Date(event.getEndTime());
    oracle.jbo.domain.Date startDate;
    try {
    startDate = new oracle.jbo.domain.Date(sdate);
    JUCtrlAttrsBinding sd =
    (JUCtrlAttrsBinding)bindings.get("start_date");
    sd.setInputValue(startDate);
    } catch (SQLException e) {
    System.out.print(e.getMessage());
    oracle.jbo.domain.Date endDate;
    try {
    endDate = new oracle.jbo.domain.Date(edate);
    JUCtrlAttrsBinding ed = (JUCtrlAttrsBinding)bindings.get("end_date");
    ed.setInputValue(endDate);
    } catch (SQLException e) {
    System.out.print(e.getMessage());
    try {
    JUCtrlActionBinding actionBinding =
    (JUCtrlActionBinding)bindings.get("ExecuteWithParams1");
    actionBinding.execute();
    } catch (Exception e) {
    System.out.println("Error executing the binding with new dates: " +
    e);
    public void setStartDate(Date StartDate) {
    this.StartDate = StartDate;
    public Date getStartDate() {
    return StartDate;
    public void setEndDate(Date EndDate) {
    this.EndDate = EndDate;
    public Date getEndDate() {
    return EndDate;
    public void setPanelFormLayout1(RichPanelFormLayout panelFormLayout1) {
    this.panelFormLayout1 = panelFormLayout1;
    public RichPanelFormLayout getPanelFormLayout1() {
    return panelFormLayout1;
    public void setInputDate1(RichInputDate inputDate1) {
    this.inputDate1 = inputDate1;
    public RichInputDate getInputDate1() {
    return inputDate1;
    public void setInputDate2(RichInputDate inputDate2) {
    this.inputDate2 = inputDate2;
    public RichInputDate getInputDate2() {
    return inputDate2;
    public void setCommandButton1(RichCommandButton commandButton1) {
    this.commandButton1 = commandButton1;
    public RichCommandButton getCommandButton1() {
    return commandButton1;
    Source File -
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document binding="#{backing_SampleGraph.document1}" id="document1">
    <af:messages binding="#{backing_SampleGraph.messages1}" id="messages1"/>
    <af:form binding="#{backing_SampleGraph.form1}" id="form1">
    <dvt:graph id="master" value="#{bindings.Master1.graphModel}"
    binding="#{backing_SampleGraph.master}"
    graphType="LINE_VERT_ABS" stylePath="Comet"
    imageFormat="FLASH"
    timeSelectorListener="#{SampleGraph.processTimeSelector}">
    <dvt:seriesSet defaultMarkerType="MT_CURVE_LINE">
    <dvt:series color="#FDB026"/>
    </dvt:seriesSet>
    <dvt:legendArea position="LAP_BOTTOM"/>
    <dvt:timeSelector id="timeSelector1" mode="EXPLICIT"
    explicitStart="#{backing_SampleGraph.startDate}"
    explicitEnd="#{backing_SampleGraph.endDate}"
    borderColor="#313675" fillColor="#33FFFFFF"/>
    </dvt:graph>
    <dvt:pieGraph id="pieGraph" imageFormat="FLASH" threeDEffect="true"
    value="#{bindings.SRsByProduct1.graphModel}"
    partialTriggers="master" style="Comet">
    <dvt:seriesSet>
    <dvt:series id="A0" pieSliceExplode="100"/>
    </dvt:seriesSet>
    <dvt:sliceLabel textType="LD_TEXT">
    <dvt:numberFormat decimalDigit="0"/>
    </dvt:sliceLabel>
    <dvt:legendArea rendered="false"/>
    </dvt:pieGraph>
    <af:panelFormLayout binding="#{backing_SampleGraph.panelFormLayout1}"
    id="panelFormLayout1">
    <af:inputDate value="#{bindings['start_date'].inputValue}"
    label="#{bindings['start_date'].hints.label}"
    required="#{bindings['start_date'].hints.mandatory}"
    shortDesc="#{bindings['start_date'].hints.tooltip}"
    binding="#{backing_SampleGraph.inputDate1}"
    id="inputDate1">
    <f:validator binding="#{bindings['start_date'].validator}"/>
    <af:convertDateTime pattern="#{bindings['start_date'].format}"/>
    </af:inputDate>
    <af:inputDate value="#{bindings['end_date'].inputValue}"
    label="#{bindings['end_date'].hints.label}"
    required="#{bindings['end_date'].hints.mandatory}"
    shortDesc="#{bindings['end_date'].hints.tooltip}"
    binding="#{backing_SampleGraph.inputDate2}"
    id="inputDate2">
    <f:validator binding="#{bindings['end_date'].validator}"/>
    <af:convertDateTime pattern="#{bindings['end_date'].format}"/>
    </af:inputDate>
    <af:commandButton actionListener="#{bindings.ExecuteWithParams1.execute}"
    text="ExecuteWithParams1"
    disabled="#{!bindings.ExecuteWithParams1.enabled}"
    binding="#{backing_SampleGraph.commandButton1}"
    id="commandButton1"/>
    </af:panelFormLayout>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_SampleGraph-->
    </jsp:root>

  • Graph Algorithm Research Tool (GART)

    In reference to this thread:
    http://forum.java.sun.com/thread.jspa?forumID=426&threadID=435407
    around reply 20 I mentioned a Graph API but never gave a URL where
    it can be accessed, mainly because it wasn't ready.
    Well, it has just been released as part of a demo application called
    Gart Demo, available at:
    http://www.graphbuilder.com

    Java's Stack extends Vector, so you can insert objects in Java's stack in other positions, not just the top. The Stack in the com.graphbuilder.struc package extends LinkedList. Both stacks (com.graphbuilder.struc and java.util) don't add any additional functionality. The only advantage of extending linked list would be for cases where you need to add or remove something to the bottom without a penalty.
    I did a lot of testing on this in terms of speed. If you need speed, then using an array based stack is much faster. In fact, if you really need speed then you use your own array and maintain your own counter.
    i would like to see an API of the collection that follows the data structure definition.This is kind of like saying, "I only want 3 methods because that is what I was taught was a stack". I agree that the concept of a stack is typically 3 methods, but the implementation of a stack is built on top of either an array or linked list.

  • A problem about the compression of directed graphs

    Right now I encountered a problem in my research that is about graph compressing (or contraction, etc.). I've searched in various ways for existing techniques on this problem and found nothing. I've been trying to figure out this problem by myself. However I would also like to seek some advice from you guys.
    The description of this problem:
    Given a directed graph G = (V, E) where V is the set of vertices and E
    is the set of directed edges. These vertices and directed edges
    represent the events and the directional relationships between pairs of
    events. Each edge is associated with a weight (or confidence score)
    which indicates the degree of the relationship. Now I want to compress
    the graph by merging some of the vertices into one superior vertex,
    which implies that several lower-level events are merged into one
    high-level event (this is mainly because the extent of news events
    defined are usually flexible). After that we can reorganize the
    vertices and edges and repeat this process until the size of the graph
    reaches a certain limit. Purely looking from the point of graph theory,
    is there any existing graph algorithm that solves this problem? As far as I have searched, the answer seems to be negative.This seems to be an interesting novel problem which falls in the area of graph algorithms. Could you suggest anything? Attached is a sample directed graph of such a kind which may be interesting.
    Check this URL to find out more about this kind of DAG:
    http://ihome.cuhk.edu.hk/~s042162/2005-05-24.jpg
    Thank you very much for your time and help.
    Regards,
    Daniel

    Sounds like an interesting problem. The temporal aspect presents an interesting wrinkle. Graph models have been becoming popular for the standard clustering problem recently, but they are typically undirected formulations. The idea of compressing a graph reminded me of work done by G. Karypis and V. Kumar on graph partitioning, some of their papers are available here:
    http://www-users.cs.umn.edu/~karypis/publications/partitioning.html
    SImilar to the reference given by matfud, with the additional restriction that there may be a size restriction on the size of the partitions or there may be multiple partitions (both restrictions make the problem NP-complete, IIRC).
    There's also the area of spectral graph partitioning which may be of interest. Its a way of finding relatively dense areas in a graph by using the eigenvalues of the adjacency matrix. Most of the results in this area are dependent on the fact that adjacency matrices for graphs are symmetric and semi-definite, which wouldn't be the case for a directed graph, but could be worth some experimentation if you have MATLAB or something similar.
    There's something else this problem reminds me of, but I can't think of it right now. Maybe later something will come to me.
    Good luck.

  • [svn] 1176: compiler: moving all the graphing classes to...

    Revision: 1176
    Author: [email protected]
    Date: 2008-04-10 10:38:20 -0700 (Thu, 10 Apr 2008)
    Log Message:
    compiler: moving all the graphing classes to... the util.graph package (ala asc)!
    Bugs: n/a
    QA: No
    Doc: No
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcMovie.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/linker/ConsoleApplication.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/linker/DependencyWalker.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/linker/FlexMovie.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/linker/SimpleMovie.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/Project.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Algorithms.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/DependencyGraph.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Edge.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Graph.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Vertex.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Visitor.java
    Removed Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/DependencyGraph.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Algorithms.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Edge.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Graph.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Vertex.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Visitor.java

    We had this same case. I used web adi to moved the the classes to the right catalogues/offerings. Use the OTA_EVENT_API.UPDATE_CLASS procedure and OTA_EVENTS_V view to get all class listings. Find the right activity_version_id and parent_offering_id of the catalogue you want the classes to moved to. Use this values to change the values of the activity_version_id and parent_offering_id of the classes you will be moving.

  • Interpretation Algorithm in Electronic Bank Reco

    Hello all
    I am configuring the Electronic Bank Reco for Citibank. However, I am  facing the following issue -
    Interpretation algorithm - For the External Transaction, I have set the algorithm as 020 - Document No Search. However, the system by default is picking WRBTR as the clearing criteria. What could be wrong in this case?
    Please guide me as to whether I am using the correct algorithm if the clearing criteria is the Payment Document No.
    Thanks in advance
    Hrishi

    Try algorithm 120 instead of 020.  I had a similar issue with algorithm 021 and was able to resolve it by switching to algorithm 121.  Because of the similarities between 020 and 021 (020 is for document numbers, 021 is for reference docs), you may be able to resolve your issue by switching to algorithm 120.
    Regards,
    Shannon

  • Tips required from algorithm practitioners on how to learn algorithms

    Hello,
    I am trying to improve my programming skills and more particularly my proficiency at algorithms.
    I decided to start with advanced sorting algorithms such as the quick sort and shell sort.
    Here is what I did in order to practise:
    -Working with a sample of data (array of integers) I started with going through the pseudo-code and manually applying each of the sort algorithms to the data with a sheet of paper in order to better understand those two algorithms.
    -Then I tried to code the algorithms in java (without looking at the code in my book of course) in Netbeans.
    Do you see other types of exercises (for now only about sorting algorithms as I will move to other algorithms later on) I could practise on in order to become more proficient?
    Best regards,
    J.

    Sounds good.
    Only other thing is try different sets of data. And try a really large set of data. Say 10,000 items. Just figuring out how to create that set can prove benefiicial.

  • Jdev 11g: several attributes are not supported by "simple" graph types

    Hi,
    My question is especially for Jdev development team. I want to discuss this issues first in this forum before I open a SR at Oracle Support.
    Several attributes from dvt:graph are not supported in dvt:areagraph, dvt:linegraph or dvt:bargraph.
    - TimeSelectorListener
    - TimeRangeMode
    - TimeAxisType --> supported for dvt:linegraph but not for dvt:areagraph. Why?
    - TimeAxisListener
    - TimeZone
    - ExplicitTimeRangeStart
    - ExplicitTimeRangeEnd
    - ContinuousTimeAxisInterval
    This means if I want (need) to use some of this attributes I need to use dvt:graph (advanced graph).
    But here is the next problem:
    This type of graph can't be selected from component palette or graph create wizard.
    It's still possible to "convert" e.g. a dvt:linegraph to dvt:graph by editing the source code of jspx but in my opinion this should not be the normal way!
    I also didn't get a clear answere if dvt:graph is desupported or will be desupported in the next release(s)
    (see my previous post about advanced graph: Jdev 11g: Advanced graph no longer supported?
    Conclusio:
    ======
    If the attributes I mention above are still supported and needed (also in further releases) than they either need to be supported by the relevant simple graph tags or dvt:graph must be selectable from component palette.
    If dvt:graph is planned to be de-supported in further releases than this should be made public to avoid development of applications with non-supported components.
    regards
    Peter

    Peter,
    you should have followed up on the thread you reference. First of all, Katia gave you the answer of how to get the listener working
    "The recommended way is to create a line graph, and then add a time selector tag (like Peter pointed out).
    However, since in the dvt:lineGraph there is no attribute for the time selector listener, you need to add the listener in the backing bean.
    Here are the code snippets:
    In jspx:
    <dvt:lineGraph id="master"
    value="#{bindings.master1Graph.graphModel}"
    style="Comet"
    imageFormat="FLASH" imageWidth="400"
    binding="#{sampleGraph.richTimeSelectorMasterGraph}"
    animationOnDisplay="AUTO"
    imageHeight="250">
    <dvt:legendArea rendered="false"/>
    <dvt:timeSelector explicitStart="#{sampleGraph.startDate}" explicitEnd="#{sampleGraph.endDate}" fillColor="#33FFFFFF" borderColor="#313675" mode="EXPLICIT" />
    <dvt:seriesSet defaultMarkerType="MT_CURVE_LINE">
    <dvt:series id="0" color="#FDB026"/>
    </dvt:seriesSet>
    </dvt:lineGraph>
    In the backing bean:
    public UIGraph getRichTimeSelectorMasterGraph()
    if (m_richTimeSelectorMasterGraph == null)
    m_richTimeSelectorMasterGraph = new UIGraph();
    m_richTimeSelectorMasterGraph.addTimeSelectorListener(this);
    return m_richTimeSelectorMasterGraph;
    public void setRichTimeSelectorMasterGraph(UIGraph graph)
    m_richTimeSelectorMasterGraph = graph;
    Second, you got Katia's attention already and this is as much developer contact you can get on this forum. Katia ia the product manager for DVT
    Frank

  • Line graph, How do graph month only on Horizontal axis?

    I'm trying to graph year trends by month on the horizontal axis. However, it keeps breaking up the months by adding the year, so I have three separate line trends. How do I fix this?

    Hi,
    You should move to the production version of JDeveloper 11g that was just released:
    http://www.oracle.com/technology/products/jdev/index.html
    However I have a answers for your questions:
    1. Setting time tick labels to hours: This should work by setting continuousTimeAxisInterval="CTAI_HOUR" on the advanced graph tag.
    Here's the tagdoc for that attribute.
    continuousTimeAxisInterval      
    Specifies the interval along a continuous time axis only if you want to override the value that the graph calculates automatically. Valid values are as follows:
    * CTAI_AUTOMATIC - (Default) Graph calculates the interval automatically.
    * CTAI_YEAR - Sets the interval to years.
    * CTAI_MONTH - Sets the interval to months.
    * CTAI_DAY - Sets the interval to days.
    * CTAI_HOUR - Sets the interval to hours.
    * CTAI_MINUTE - Sets the interval to minutes.
    * CTAI_SECOND - Sets the interval to seconds.
    2. Vertical gridlines can be set by using the o1Axis tag and setting the tickStyle. This should change all o1Axis ticks to gridlines. For different lineStyles, you can also use the lineStyle attribute.
    <dvt:graph>
    <dvt:o1MajorTick tickStyle="GS_GRID"/>
    </dvt:graph>
    Hope this helps
    Katia

Maybe you are looking for