Bipartite graph representation

I am trying to figure out the best way to implement a bipartite graph. So far, I am using a hashmap to keep track of vertices that link a string name to a vertex node (whose field contains an arraylist of adjacent vertices). I'm not sure if using one hashmap is ok for bipartite graph implementation. Would I need two hashmaps to keep track of vertices in each disjoint set or should I be using a completely different ADT all together? Thanks.

Then, so far you have a fairly standard graph representation. So you have a representation of the graph. But now you think you need some special data structure to describe its bipartiteness? Okay, add that on. The vertices of the graph divide themselves into two subsets, right? So make two sets of vertices.

Similar Messages

  • Bipartite graph ADT

    Is it possible to represent a bipartite graph in a single adjacency list using a hashmap? Or would I need to use two hashmaps for each disjoint set?

    I don't see what difference it makes if the graph is bipartite, or connected, or complete, or not connected, or anything else.
    And the Wikipedia article "adjacency list" says there's a representation of an adjacency list in the form of a hash table, so I would say Yes.

  • Single Line and Stacked Bar Graph Representation

    Data to be plotted on graph is as follows
    Year and Month               Study               Planned Subject               Study-Site ID #               # Enrolled          
    2001 / 03          AMXN 9374               50     US-001               1          
    2001 / 04               AMXN 9374               50               FR-101               1          
    2001 / 04               AMXN 9374               50               SP-301               1          
    2001 / 04               AMXN 9374               50               US-001               2          
    2001 / 05               AMXN 9374               50               FR-101               1          
    2001 / 05               AMXN 9374               50               US-001               1          
    2001 / 06               AMXN 9374               50               FR-101               2          
    2001 / 06               AMXN 9374               50               SP-301               2          
    2001 / 06               AMXN 9374               50               US-001               1          
    I want to display the above data in line stacked bar graph format where the
    #Enrolled will be in Stacked Bar by Study -Site ( Y axis)
    Planned Subject should represent a single line at 50 ( Y axis)
    Group by Year and Month ( X- Axis)
    Study excluded ( Study will be selected from dashboard prompt)
    I'm getting the stacked view of Study Site ID correctly but I want Single Line for Planned Subject .
    Currently I'm getting multiple line .
    Eg for 2001/03 I'm getting line at 50 in yellow colour
    for 2001/04 I'm getting a line at 150 in different color since it has 3 Study-Site ID's But the desired output is Single Line at 50
    As per 11g doc this is not possible because there is some upgradation in the nature of the graph
    " Stacked line-bar graphs in which 2 or more measures are shown as lines on the same axis and are not stacked in 10g are stacked in 11g."
    Refer - http://docs.oracle.com/cd/E21764_01/bi.1111/e16452/apndx_ui_chngs.htm
    Is there any workaround for it ?

    Did you found any workaround for it ? I am too looking for same scenerio.

  • In SE30, what the graph represents

    hi
    when we analyse the performance of a particular report or BDC using SE30 , we will get a graph. How to analyze that graph. what the graph indicates. how the graph should appear for a better performance report.
    need the answer more clearly.

    Hi,
    There are three componetnts of the garph as follows:
    1. ABAP RUN-TIME
       This is the time out of the Total execution time for which the program had taken 
       to execute ABAP statements of the program (here we can differentiate Time
       spend on Database Trace(e.g. Select Query statement) and on ABAP Trace
       (e.g.Loop at ...and other)).
    2. DATABASE RUN-TIME
        This is time spend by the program out of total execution time on Database
        Trace.
    3. SYSTEM RUN-TIME
        This is time taken by system for its internal tasks like assigning work process
        etc.
    Tips for Better Performance:
    We have to write program such that it will spend very less time on the Database, As it is not advisable to lock some DB tables for long time.
    We should utilise whole ABAP trace as it is much faster than DB trace.
    e.g. Avoid using Select.........Endselect....
    Use For all entries in or use internal tables to improve the performance.
    Regards,
    Ranjit Thakur.
    <b>Please Mark The Helpful Answer.</b>

  • Noges and Edges(graph) representation in Flex

    Hi,
    We want to develop a component to render a graph representing nodes and edges using flex without using a third party API.
    Can anyone share your views or how can it be done?
    Thanks & Regards,
    Madhavi

    Hi,
    You can make your own charts (Bar, Pie etc etc). U would have to use drawnig API of flash.
    Can read on it @ http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7dce.html
    Using Graphics class you can make your own logic to make different charts.
    For  reference:  http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics. html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2
    Thanks.
    Abhinav

  • XY graph plot colour

    Hi All,
    I have a problem with the XY Graph representation.
    I'm trying to show different plot with different colours in the same graph.
    I realized a VI (8.2 Labview version), but it is wrong because at every iteration all the trace are re-colored with the same
    colour.
    I have two 1D array (X array and Y array) and my goal is to show every (X,Y) point with different colours.
    Could please someone help me?
    I attached the VI and a Front Panel screenshot.
    Thanks in advance for your support,
    Francesco.
    Attachments:
    XYGraph&Color.vi ‏47 KB
    XYGraphColorFrontPanel.JPG ‏164 KB

    Please take a look at this. Hope it helps.
    Message Edited by NitinD on 28-08-2009 07:04 PM
    Attachments:
    XYGraph&Color.vi ‏21 KB
    xygraph.jpg ‏102 KB

  • XY graph plot export ?

    Good Day! Can someone help me.....i have some problem with my XY graph representation. How do i generate a function that reads a value of the X axis of the plot and automaticaly gives me the corespondent value on the y axis. I attached two pictures regarding the plot in cause.I tried using the cursor of the waveform graph by checking Allow Dragging>>Single plot . The cursor now follows my plot but it moves only from point to point (the points can be seen in the atachement).I want to make the cursor to move along the plot and give me at a specific X value the corespondent  value on the Y axis. Thank you ...excuse my language) my English is a bit rusty . Have a nice day 
    Attachments:
    ScreenHunter_02 May. 30 11.39.jpg ‏60 KB
    ScreenHunter_01 May. 30 11.38.jpg ‏64 KB

    Do a polynomail fit, then use Polynomial evaluation using the coefficient obtained earlier to get the function value for any x.
    (Of course if there is a theory and a more specific model for the data, you can use nonlinear fit)
    LabVIEW Champion . Do more with less code and in less time .

  • Bar Graph Click Listener Should Open a Tab

    Hi,
    We have got a special requirement: Our application has 6 tabs. The first tab is the Dashboard. On Dashboard, we have few bar graphs. And each graph represents the current status of remaining 5 tabs.
    And the requirement is, when the user clicks on any bar graph, respective tab should get opened. We easily achieved this when using a button/ Command Link/ Command Image Link as because they are supporting action event.
    In case of bargraph, we are not getting this happened. Could you please let me know if there any way for us to achieve this requirement.
    And FYI … here is the dashboard screen shot of our application. As per the below URL, when user clicks on the bar of Request bar graph, the Requests tab should get opened.
    https://picasaweb.google.com/112002138169335747235/IssueWithBarGraph?authuser=0&feat=directlink
    Here is the code snippet for the same:
    public void alertsBarGraphListener(ClickEvent clickEvent) {
    UIComponent uiComponent = clickEvent.getComponent();
    if (uiComponent instanceof UIGraph ) {
    String id = uiComponent.getId();
    List<UIComponent> panelTabs = this.mainMenuTabs.getChildren();
    boolean foundTab = false;
    for(UIComponent tab: panelTabs) {
    if(tab instanceof RichShowDetailItem) {
    String[] triggerIds = ((RichShowDetailItem)tab).getPartialTriggers();
    if(triggerIds !=null) {
    for(String triggerid : triggerIds) {
    if(id.equals(triggerid)) {
    this.dashBoardDetailItem .setDisclosed(false);
    ((RichShowDetailItem)tab).setDisclosed(true);
    foundTab = true;
    Please let me know your comments.
    Thanks & Regards,
    Kiran Konjeti

    After setting the disclosed property for the tabs, you would need to have PPR to the panelTab in order to reflect the changes in UI.
    Here, is an sample based on your use-case:
    TestPage.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    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=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    *<af:panelTabbed id="pt1" binding="#{TestPageBean.panelTab}">*
    *<af:showDetailItem text="Graph" id="sdi1">*
    *<dvt:barGraph id="barGraph1" subType="BAR_VERT_CLUST"*
    *clickListener="#{TestPageBean.clickListener}">*
    *<dvt:background>*
    *<dvt:specialEffects/>*
    *</dvt:background>*
    *<dvt:graphPlotArea/>*
    *<dvt:seriesSet>*
    *<dvt:series/>*
    *</dvt:seriesSet>*
    *<dvt:o1Axis/>*
    *<dvt:y1Axis/>*
    *<dvt:legendArea automaticPlacement="AP_NEVER"/>*
    *</dvt:barGraph>*
    *</af:showDetailItem>*
    *<af:showDetailItem text="Another Tab" id="sdi2">*
    *<af:commandButton text="Button in another tab" id="cb1"/>*
    *</af:showDetailItem>*
    *</af:panelTabbed>*
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    *TestPageBean.java:*
    package view.bean;
    import java.util.List;
    import javax.faces.component.UIComponent;
    import oracle.adf.view.faces.bi.event.ClickEvent;
    import oracle.adf.view.rich.component.rich.layout.RichPanelTabbed;
    import oracle.adf.view.rich.component.rich.layout.RichShowDetailItem;
    import oracle.adf.view.rich.context.AdfFacesContext;
    public class TestPageBean {
    private RichPanelTabbed panelTab;
    public TestPageBean() {
    public void clickListener(ClickEvent clickEvent) {
    List<UIComponent> showDetailItems = this.panelTab.getChildren();
    for (UIComponent showDetailItem : showDetailItems) {
    RichShowDetailItem currentRichShowDetailItem =
    (RichShowDetailItem)showDetailItem;
    currentRichShowDetailItem.setDisclosed(false);
    if (currentRichShowDetailItem.getText().equals("Another Tab")) {
    currentRichShowDetailItem.setDisclosed(true);
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(this.panelTab);
    public void setPanelTab(RichPanelTabbed panelTab) {
    this.panelTab = panelTab;
    public RichPanelTabbed getPanelTab() {
    return panelTab;
    Thanks,
    Navaneeth

  • Directed graphs

    Help
    Having a problem with my directed graph, and its been frying my head. from the test that I've ran ita ppears to be working sort of the problem that I'm having is once I've created a node, I then attach an edge to that node, however where there are multiple edges it will only attach the last edge that it comes to. I'm creating a list of nodes, then trying to attach a list of edges to that particular node.
    code listing - theres a lot, sorry
    /////////////////////// edge class /////////////////////////
    //: Gedge.java
    /************************* Revision History *************************
    *     v1.0 - Initial version:
    public class Gedge implements IGedge{
         //labels for the edges
         private Object s, l;
         //nodes representing stations outbound and inbound
         private Gnode src, in, out;
         //linked list of edges
         private Gedge nextOutEdge;
         private Object o, i;
         * Default constructor Gedge
         * @param Gnode outbound:
         * @param Gnode inBound:
         * @param Object stationID:
         * @param Object lineName:
         public Gedge ( Gnode source, Gnode inDest, Gnode outDest, Object outBound, Object inBound, Object stationID, Object lineName ){
              o = outBound;
              i = inBound;
              s = stationID;
              l = lineName;
              src = source;
              in = inDest;
              out = outDest;
              //dest1 = null;
              nextOutEdge = null;
         }//end of constructor
         /////////////// Accessors ///////////////
         public Object getInBound() {
              return ( ( String ) i );
         }//end of getInBound
         public Object getOutBound() {
              return ( ( String ) o );
         }//end of getOutBound
         * @return
         public Object getLineName() {
              return ( ( String ) l );
         }//end of getLineBound
         public Object getStationID(){
              return ( ( String ) s );
         * @return
         public Gedge getNextEdge(){
              return nextOutEdge;
         }//end of getNextEdge
         * @return
         public Gnode getSource(){
              return src;
         }//end of getSource
         * @param newNextEdge
         public Gnode getInDest(){
              return in;
         * @param newNextEdge
         public Gnode getOutDest(){
              return out;
         * @param newNextEdge
         //public Gnode getDest1(){
         //     return dest1;
         /////////////// Transformers ///////////////
         public void setNextEdge( Gedge newNextEdge){
              nextOutEdge = newNextEdge;
         }//end of setNextEdge
         public void setInBound( Object inBound ) {
              i = inBound ;
         }//end of setDest
         public void setOutBound( Object outBound ) {
              o = outBound;
         }//end of setSource
         public void setLineName( Object lineName ) {
              l = lineName;
         }//end of setLineName
    }///:~
    ///////////////// end of edge class /////////////
    ///////////////node class////////////////
    //: Gnode.java
    /************************* Revision History *************************
    *     v1.0 - Initial version:
    public class Gnode implements IGnode {
         private Object id, name;
         private Comparable d;
         private Gnode nextNode;
         private Gedge firstEdge, nextOutEdge;
         private int outDegree;
         public Gnode ( Comparable data, Object stationName, Object stationID){
              d = data;
              id = stationID;
              name = stationName;
              outDegree = 0;
              nextNode = null;
              firstEdge = null;
              nextOutEdge = null;
         }//end of constructor
         /////////////// Accessors ///////////////
         public Object getID() {
              return ( ( String ) id );
         }//end of getID()
         public Object getStationName() {
              return ( ( String ) name );
         }//end of getStationName
         public Comparable getData() {
              return d;
         }//end of getData
         * @return
         public Gnode getNextNode(){
              return nextNode;
         }//end of getNextNode
         * @return
         public int getOutDegree(){
              return outDegree;
         }//end of incOutDegree
         * @return
         public Gedge getNextEdge(){
              return nextOutEdge;
         }//end of getFirstOutEdge
         * @return
         public Gedge getFirstEdge(){
              return firstEdge;
         /////////////// Transformers ///////////////
         public void setStationName( Object stationName ){
              name = stationName;
         }//end of setStationName
         * @param data
         public void setComparable( Comparable data ){
              d = data;
         }//end of setComparable
         public void setStationID(Object stationID) {
              id = stationID;
         }//end of setStationID
         * @param newNext
         public void setNextNode( Gnode newNode ){
              nextNode = newNode;
         }//end of setNextNode
         public void setNextEdge( Gedge edge ){
              nextOutEdge = edge;
         }//end of setFirstOutEdge
         public void setFirstEdge( Gedge edge ){
              firstEdge = edge;
         }//end of setFirstOutEdge
         public void incOutDegree(){
              outDegree++;
         }//end of incOutDegree
    }///:~
    //////////////end of node class /////////////
    ////////////// graph class ////////////////////
    //: AMGraph.java
    /************************* Revision History *************************
    *     v1.0 - Initial version:
    public class AMGraph implements IAMGraph {
         //2D-Array of graph nodes
         protected Gnode firstNode, node;
         //graph edges
         protected Gedge firstEdge, edge;
         private int gSize;
         /////////////// Constructor ///////////////
         public AMGraph(){
              firstNode = null;
              firstEdge = null;
              gSize = 0;
         /////////////// Accessors ///////////////
         public boolean isEmpty() {
              if ( firstNode == null){
                   return true;
              return false;
         }//end of isEmpty
         public boolean hasNeighbour() {
              // TODO Auto-generated method stub
              return false;
         }//end of hasNeighbour
         public int outDegree() {
              // TODO Auto-generated method stub
              return 0;
         }//end of outDegree
         public int inDegree() {
              // TODO Auto-generated method stub
              return 0;
         }//end of inDegree
         public void findPath(Object outBound, Object inBound) {
              // TODO Auto-generated method stub
         }//end of findPath
         public void printStationList(){
              Gnode temp = node;
              while( temp != null ){
                   System.out.println( temp.getID()+" "+temp.getStationName() );
                   temp = temp.getNextNode();
         }//end of printStationList
         public void printEdgeList( Gnode source ){
              Gedge temp;
              temp = source.getNextEdge();
              while( temp != null ){
                   System.out.println( temp.getStationID()+" out "+temp.getOutBound()+" in "+temp.getInBound() );
                   temp = source.getNextEdge();
         }//end of printEdgeList
         * @return
         public int getOutDegree ( ){
              int degree = 0;
              while( node != null ){
                   degree = node.getOutDegree();
                   node = node.getNextNode();
              return degree;
         }//end of getOutDegree
         * @param data
         * @return
         public Gnode getGNode ( String data ){
              Gnode temp = node;
              while( temp != null ){
                   if( temp.getID().equals(data) ){
                        return temp;
                   else{
                        temp = temp.getNextNode();
              return null;
         }//end of getGnode
         public boolean containsEdge( Gnode node0, Gnode node1) {
    Gnode source = node0, dest = node1;
    Gedge tempEdge = source.getNextEdge();
    while ( tempEdge != null){
         if ( tempEdge.getOutBound().equals( dest.getID() ) ){
              System.out.println("true");
              return true;
         else{
              tempEdge = tempEdge.getNextEdge();
    System.out.println("false");
    return false;
         }//end of containsEdge
         /////////////// Transformers ///////////////
         public void addNode( Comparable data, Object stationName, Object stationID ) {
              node = new Gnode( data, stationName, stationID );
              if ( firstNode == null ){
                   firstNode = node;
              else{
                   node.setNextNode( firstNode );
                   firstNode = node;
    gSize++;
         }//end of addNode
         public void addEdge( Gnode source, Gnode oBound, Gnode iBound, Object outBound, Object inBound, Object stationID, Object lineName ) {
    Gnode s = source;
    Gnode o = oBound;
    Gnode i = iBound;
    edge = new Gedge( s, o, i, outBound, inBound, stationID, lineName);
         s.setNextEdge( edge );
         edge.setNextEdge( s.getNextEdge() );
         }//end of addEdge
         public void removeNode(Comparable data) {
              // TODO Auto-generated method stub
         }//end of removeNode
         public void removeEdge(Comparable data) {
              // TODO Auto-generated method stub
         }//end of removeEdge
    //////////////////////// end of graph class ////////////////////
    ///////////////////driver////////////////////////
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.StringTokenizer;
    * This class reads a text description of a metro subway system
    * and generates a graph representation of the metro.
    *<p>
    * The grammar for the file is described below in BNF. A typical line
    * in the file looks like this :
    * <code> 20 NorthStation Green 19 22 Orange 15 22 </code>
    * where :
    * 20 is the StationID
    * NorthStation is the StationName
    * Green 19 22
    * Green is the LineName
    * 19 is the StationID of the outbound station
    * 22 is the StationID of the inbound station
    * Orange 15 22 is a LineID in which :
    * Orange is the LineName
    * 15 is the StationID of the outbound station
    * 22 is the StationID of the inbound station
    * Therefore, NorthStation has two outgoing lines.
    * note : 0 denotes the end of a line : i.e. in this case,
    * OakGrove would be at the end of the line, as there is no other outbound
    * station.
    *<p>
    * metro-map ::= station-spec* <BR>
    * station-spec ::= station-id station-name station-line+ <BR>
    * station-id ::= (positive integer) <BR>
    * station-name ::= string <BR>
    * station-line ::= line-name station-id station-id <BR>
         public class MetroMapParser {
              private BufferedReader fileInput;
              static AMGraph graph = new AMGraph();
              LinkedList l = new LinkedList();
              public static void main(String[] args){
                   if(args.length != 1){
                        usage();
                        System.exit(0);
                   String filename = args[0];
                   try{
                        MetroMapParser mmp = new MetroMapParser(filename);
                        mmp.generateGraphFromFile();
                   catch(Exception e){
                        e.printStackTrace();
              private static void usage(){
                   //prints a usage message to System.out
                   System.out.println("java ex3.MetroMapParser <filename>");
              * @effects: creates a new parser that will read from the file
              * filename unless the file does not exist. The filename should specify
              * the exact location of the file. This means it should be something like
              * /mit/$USER/6.170/ex3/bostonmetro.txt
              * @throws java.io.IOException if there <tt>filename</tt> cannot be read
              * @returns a new MetroMapParser that will parse the file filename
              public MetroMapParser(String filename) throws IOException{
                   //     a buffered reader reads line by line, returning null when file is done
                   fileInput = new BufferedReader(new FileReader(filename));
              * @effects: parses the file, and generates a graph from it, unless there
              * is a problem reading the file, or there is a problem with the format of the
              * file.
              * @throws java.io.IOException if there is a problem reading the file
              * @throws ex3.BadFileException if there is a problem with the format of the file
              * @returns the Graph generated by the file
              public void generateGraphFromFile()
                   throws IOException, BadFileException{
                   String line = fileInput.readLine();
                   StringTokenizer st;
                   String stationID;
                   String stationName;
                   String lineName = null;
                   String outboundID = null, inboundID = null;
                   while(line != null){
                        st = new StringTokenizer(line);
                        //          We want to handle empty lines effectively, we just ignore them!
                        if(!st.hasMoreTokens()){
                             line = fileInput.readLine();
                             continue;
                        //from the grammar, we know that the Station ID is the first token on the line
                        stationID = st.nextToken();
                        if(!st.hasMoreTokens()){
                             throw new BadFileException("no station name");
                        //     from the grammar, we know that the Station Name is the second token on the line.
                        stationName = st.nextToken();
                        graph.addNode( stationName, stationName, stationID );
                        if(!st.hasMoreTokens()){
                             throw new BadFileException("station is on no lines");
                        while(st.hasMoreTokens()){
                             lineName = st.nextToken();
                             if(!st.hasMoreTokens()){
                                  throw new BadFileException("poorly formatted line info");
                             outboundID = st.nextToken();
                             if(!st.hasMoreTokens()){
                                  throw new BadFileException("poorly formatted adjacent stations");
                             inboundID = st.nextToken();
                             //working like this although print edgelist appears to be going into infinite loop
                             graph.addEdge( graph.getGNode( stationID ) , graph.getGNode( outboundID ), graph.getGNode( inboundID ), outboundID, inboundID, stationID, lineName );
                        line = fileInput.readLine();
    //////////////////end of driver//////////////////
    /////////////// this is the info I'm testing put in a txt file//////////
    1 M               Blue 5 3 Red 2 5
    2 N               Blue 4 1
    3 O               Blue 1 5 Red 0 4
    4 P               Blue 5 2 Red 3 5
    5 Q               Blue 1 4 Red 3 2
    ////////////////end of txt file///////////////////

    that didn't come out to well - try again
    Help Having a problem with my directed graph, and its been frying my head. from the test that I've ran ita ppears to be working sort of the problem that I'm having is once I've created a node, I then attach an edge to that node, however where there are multiple edges it will only attach the last edge that it comes to. I'm creating a list of nodes, then trying to attach a list of edges to that particular node. code listing - theres a lot, sorry
    //////////////////// graph class ///////////////
    //: AMGraph.java
    /************************* Revision History *************************
    *     v1.0 - Initial version:
    public class AMGraph implements IAMGraph {
         //2D-Array of graph nodes
         protected Gnode firstNode, node;
         //graph edges
         protected Gedge firstEdge, edge;
         private int gSize;
         /////////////// Constructor ///////////////
         public AMGraph(){
              firstNode = null;
              firstEdge = null;
              gSize = 0;
         /////////////// Accessors ///////////////
         public boolean isEmpty() {
              if ( firstNode == null){
                   return true;
              return false;
         }//end of isEmpty
         public boolean hasNeighbour() {
              // TODO Auto-generated method stub
              return false;
         }//end of hasNeighbour
         public int outDegree() {
              // TODO Auto-generated method stub
              return 0;
         }//end of outDegree
         public int inDegree() {
              // TODO Auto-generated method stub
              return 0;
         }//end of inDegree
         public void findPath(Object outBound, Object inBound) {
              // TODO Auto-generated method stub
         }//end of findPath
         public void printStationList(){
              Gnode temp = node;
              while( temp != null ){
                   System.out.println( temp.getID()+" "+temp.getStationName() );
                   temp = temp.getNextNode();
         }//end of printStationList
         public void printEdgeList( Gnode source ){
              Gedge temp;
              temp = source.getNextEdge();
              while( temp != null ){
                   System.out.println( temp.getStationID()+" out "+temp.getOutBound()+" in "+temp.getInBound() );
                   temp = source.getNextEdge();
         }//end of printEdgeList
         * @return
         public int getOutDegree ( ){
              int degree = 0;
              while( node != null ){
                   degree = node.getOutDegree();
                   node = node.getNextNode();
              return degree;
         }//end of getOutDegree
         * @param data
         * @return
         public Gnode getGNode ( String data ){
              Gnode temp = node;
              while( temp != null ){
                   if( temp.getID().equals(data) ){
                        return temp;
                   else{
                        temp = temp.getNextNode();
              return null;
         }//end of getGnode
         public boolean containsEdge( Gnode node0, Gnode node1) {
    Gnode source = node0, dest = node1;
    Gedge tempEdge = source.getNextEdge();
    while ( tempEdge != null){
         if ( tempEdge.getOutBound().equals( dest.getID() ) ){
              System.out.println("true");
              return true;
         else{
              tempEdge = tempEdge.getNextEdge();
    System.out.println("false");
    return false;
         }//end of containsEdge
         /////////////// Transformers ///////////////
         public void addNode( Comparable data, Object stationName, Object stationID ) {
              node = new Gnode( data, stationName, stationID );
              if ( firstNode == null ){
                   firstNode = node;
              else{
                   node.setNextNode( firstNode );
                   firstNode = node;
    gSize++;
         }//end of addNode
         public void addEdge( Gnode source, Gnode oBound, Gnode iBound, Object outBound, Object inBound, Object stationID, Object lineName ) {
    Gnode s = source;
    Gnode o = oBound;
    Gnode i = iBound;
    edge = new Gedge( s, o, i, outBound, inBound, stationID, lineName);
    /*works sort of*/
         s.setNextEdge( edge );
         edge.setNextEdge( s.getNextEdge() );
    /*finish working here sort of*/
         }//end of addEdge
         public void removeNode(Comparable data) {
              // TODO Auto-generated method stub
         }//end of removeNode
         public void removeEdge(Comparable data) {
              // TODO Auto-generated method stub
         }//end of removeEdge
    ////////////// end of graph class////////////////

  • Please Help: How to represent graphs for pathfinding

    Hi, I am quite new to pathfinding, I understand that I have to use graphs, but I have difficulty on understanding how to represnt the graph in java. I need to represent nodes and edges, and state which nodes are connected to each other and the cost (distance) associated for travelling between those two nodes. So that I can later use a pathfinding strategy to find the shortest path.
    I would be very grateful if anyone can guide me in this matter, on saying what kind of data structure is suitable, possibly using a little example.
    Thank you.

    Adjacency list
    Edge list
    Adjacency matrix
    Incidence matrixWhat you need to do is to isolate the graph representation in a Graph class and then try to figure out what aspects of a graph you're interested in (what kind of methods you'd like to be available in Graph). Sometimes one specific representation will be perfect for your needs but sometime you'll need a combination of different representations. You can start with the representation you find easiest to handle maybe a 2D matrix where the rows/colums represent from/to nodes, and the elements are the costs. Later if you discover you need something else you need to make changes to Graph only.

  • OLAP Graphs....

    Post Author: shin_11
    CA Forum: Charts and Graphs
    Hi AllI am using Crystal report xi rel 2, I am developing a report where the data comes from a sql cube 2000. I have insert the OLAPgrip showing all the dimension names and values and also inserted a graph. One of my dimensions is called 'measure' nowthe graph represents 'One change of Time'/ 'Subdivided by Workflow'..I do have the option of 'other dimensions' and is here where I select 'Measure' but I want to select 2 of the dimension attributes rather one. So in my graph I get 2 split blocksper time block.I hope this make senses....Please can you help....Thanks

    Hi James,
    Could you please clarify which version of BI Beans and Oracle 9i OLAP you are referring too?
    Am I right in presuming you want to use the BI Beans presentation objects to display data from a non-OLAP data source? We do have support for non-OLAP data sources, including say XML data sources.
    I can certainly help, if you could please provide the information above.
    Many Thanks
    BI Beans
    Product Management
    Has anyone managed to use the BI Presentation beans to create a graph without the OLAP Service in place?
    I understand that this is supposed to be possible, but keep coming back to the OLAP Service which ever route I seem to take. I've looked at the online docs but they arte pretty light and can't find anything that gives me a clear pointer.
    Any help would be gratefully appreciated. Thanks

  • OLAP Graph

    Post Author: shin_11
    CA Forum: Olap
    Hi AllI am using Crystal report xi rel 2, I am developing a report where the data comes from a sql cube 2000. I have insert the OLAPgrip showing all the dimension names and values and also inserted a graph. One of my dimensions is called 'measure' nowthe graph represents 'One change of Time'/ 'Subdivided by Workflow'..I do have the option of 'other dimensions' and is here where I select 'Measure' but I want to select 2 of the dimension attributes rather one. So in my graph I get 2 split blocksper time block.I hope this make senses....Please can you help....Thanks

    Hi Priscilla.
    This is same for both Plus and Plus OLAP.
    Graph values don't respect format of the values in underlaying table.
    Table's 15% is displayed as 0.15 in graph, table's 15 is displayed as 15.00 in graph!!
    In many situations Discoverer is a very poor tool. Unfortunately these "small details" are usually very important for the end users (Often it is the first thing the end user noticed)!!
    If I am wrong and anybody knows a solution please let us know.!
    Thnaks.
    Jakub.

  • Path determination within a graph

    Hey everyone, Heres my problem (sorry if its a bit long winded :)
    In a database I have a list of states and all these states have successors and predecessors (which are themselves states)
    This is an envisionment created by a Model Based Reasoning Engine.
    Now what I am doing is trying to determine if a path between a start state and an end state is possible.
    My problems are:
    1) There are around 1.3 million edges in this graph so they all cannot be loaded into memory at the same time.
    2) I also have to display the path between the start and end states.
    3) The graph is completely unweighted so will have to use some blind search algorithm?!
    If anyone has any ideas then i'd appreciate if they'd get back to me.
    Thanks :)

    According to sabre's calculation, you could pack the adjacency matrix into a byte array.
    A sparse matrix is just a way of compressing a matrix that has a lot of zeros. It usually works by storing only the non-zeros along with indexing information. Google "column compressed sparse" and you will find examples. There are graph representations that work on similar ideas, like uh... edge list structures, adjacency list... and maybe a couple of others that I can't remember. It shouldn't be a problem to store 1.3 million edges as long as you size the JVM heap properly wiht the -Xmx option. If your problems get too big, using a lazy approach where you only read a portion of the problem from a database would probably be the best approach, despite what this may do to performance. If you haven't got the memory, you haven't got the memory...

  • How do I get more than 10 Y axis chart labels on a line chart

    I cannot find a way to get more than 10 y axis labels on a line chart. In AppleWorks you set your step size so a size of "10" which in my case equates to labels of 10, 20, 30, ..., 80, 90 and so on up to the MAX value. I would often have 20 or more labels. In iWork the size is the number of labels and the maximum size (number of labels) I can display is 10. With a min value of 30 and a max value of 330 each label jumps 30 points which doesn't give the resolution I need to see...and....when showing the data point values on the page in iWork they overlap each other and are unreadable even when stretched out on legal paper.

    What I am calling the X axis (horizontal) you are calling the Y axis. I need more than 10 labels on the vertical axis. Space for text is not a problem. I already have done exactly what you suggest for the horizontal axis. What I need is to get 30 value labels on the vertical axis (You show 5 in your example) along with the many more than 10 I have on the horizontal axis. The 10 through 300 value labels run vertically, and roughly 90 data points, one per day covering 3 months runs horizontally with a date label every 7 days. This graph represents values recorded daily at the same time each day.

  • CMS Tracks - best practice?

    Hi,
    we are developing our product with CVS right now and want to move over to DTR. The basic concepts are clear and I did a test migration yet which is successful.
    But I am unclear on the chamge management piece:
    Let's say we develop a version 1.0
    Now this version has service packs 1.0 SP1, SP2, SP3 and so on. These service packs also have to be maintained, they might contain bugs, so you could have something like
    1.0 SP1 Patch 1, 1.0 SP1 Patch 2 and so on.
    How do I handle this with CMS tracks? Whats the best practice? Do I setup a track for every major version and for every support package in that version? I.E. i will have a track 10SP0, 10SP1, 10SP2, 10SP3 and so on? Will this work?
    Right now we have a lot of CVS tags and branches to make this work... but how do you do that in DTR? I need to be able to jump back to a specific version and SP and fix bugs in there if a customer needs it.
    In CVS the concept is that I will develop in HEAD and bugfix in branches (which is all in the same repository / "workspace"). But in DTR how do I do it? Is there something analog to this? Or do I always just use the track with the highest versio number as the "HEAD"?
    Any input is appreciated.
    Thanks
    Bruno

    Hello Bruno,
    For each state of your product that you wish to maintain, you must create a track. So in your case, you will have a track structure as follows:
    Track1.0
    Track1.0_SP1
    Track1.0_SP2
    DTR does not support tags (yet), so the state that you wish to retain for possible future fixes must be isolated in a workspace of a given track. That is, "Track1.0_SP1" will contain the workspaces that represent the SP1 state, and a fix for SP1 must be done in this track.
    And you must develop on the Main Release track ("Track1.0") and do the bugfixes in the track for the approrpriate SP. You should set up a transport connection of type "Repair" from each SP track to the Main Release track, so the fixes you make in the SP track are automatically back-transported to the Main Release track. (This connection can be setup in the "Track Connections" tab in the CMS Landscape Configurator.)
    Also note that the DTR version graph represents a global version history, so for any file you will be able to view the changes made in the different tracks (workspaces) from the Version Graph view (in the DTR Perspective of the SAP NetWeaver Developer Studio).
    Regards,
    Manohar

Maybe you are looking for

  • Material loss in stock transfer

    Dear All can you please suggest how to compensate / adjust the material loss in stock transfer for 1) inter copany stock transfer 2) intra company stock transfer Regards Nil

  • I want excellent quality slide shows to dvd

    I have been using iPhoto 6 to make slide shows set to music and then send them to IDvd to burn. After this process is complete, I am disappointed with the quality of the finished product. I am a pro photographer who shoots raw files with a Nikon D200

  • When I updated my IPad my YouTube App disappeared. How can I get it back?

    When I updated my IPad my YouTube App disappeared. How can I get it back?

  • Webservice to RFC scenario

    Hi In the webservice to RFC scenario i am trying to create a webservice from the tools->define webservice option. the system takes to me a webservice creaton wizard and it asks for the Integration Server SOAP inbound channel URL I know that the  synt

  • HT204389 Why can't Siri provide direction or work on maps in India?

    Hey, I am iphone 5 user. I am from India. Many of us Indians use apple products but there is simple thing which guys have been ignoring or may really didn't care is that, We can't use Siri for direction or any other local use as it should help us. Ne