<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      <br>
      Is there any sort of time tablethisn idea?<br>
      <br>
      I must admit,  I have a need for this type of thing and with out
      looking at the existing code its difficult to comment. <br>
      <br>
       Due to the nature of the data that I am working with every node
      has its set of data, so I prefer a solution that uses a generic
      sql expression as a parmeter i.e. something like<br>
      <br>
      select target,cost,reverse_cost, etc where source =XXXXX<br>
      <br>
      Where XXXXX is a supply argument that gets provided invoked when
      data is need.<br>
      <br>
      Dave.<br>
      <br>
      On 19/05/13 15:58, Daniel Kastl wrote:<br>
    </div>
    <blockquote
cite="mid:CABXBSH99bBgmdkFWoziRrQVtSjqMt9s_s4W+oJnBzxFbVESGHA@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div class="im">
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
                  SELECT * FROM pgr_tsp( 'SELECT id, start, end, cost
                  FROM distances,<br>
                  origin int [, destination int])<br>
                </blockquote>
                <br>
              </div>
              I can do this, so each record is one cell. What are
              "start" and "end"? are these vertex ids or are they
              indices? Does the use KNOW that they need to also have a
              row for (end,start) as well as (start,end)? These things
              are less obvious and there for have more room for errors.<br>
            </blockquote>
            <div><br>
            </div>
            <div style="">Well start and end is just "id1" and "id2".</div>
            <div style="">You could actually also have two costs there,
              one for each direction (like cost and reverse_cost).</div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
              I suppose we could write an aggregate function that takes
              your query and returns matrix[][]. But we still need to
              define how to deal with null values in the matrix.<br>
            </blockquote>
            <div><br>
            </div>
            <div style="">I know I said "matrix", but actually I didn't
              think about matrix ;-)</div>
            <div style="">I thought about pairs of id's with cost(s). So
              it wouldn't be an [m][m] matrix but more like a table with
              m*m/2 records (if there is a cost for each direction for
              each combination).</div>
            <div style="">I don't know how it should be later internally
              for the algorithm, but I would say, that a query (table)
              always has a fix number of columns and a variable number
              of rows.</div>
            <div style=""><br>
            </div>
            <div style="">In the end this would look like a graph, where
              all nodes are connected with all nodes. </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
              select pgr_makematrix(i, j, cost) from<br>
                  (select start as i, end as j, cost from distances) as
              foo;<br>
              <br>
              Then this could be passed as the SQL to the TSP. We need
              to keep each function simple and make them chainable or we
              limit the usefulness of them.<br>
            </blockquote>
            <div><br>
            </div>
            <div style="">Exactly ;-)</div>
            <div style=""> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
              Any thoughts on how to deal with NULLs in the matrix?<br>
              <br>
              We could have some default rules like?<br>
              1. if the null is on a diagonal set it to zero<br>
              2. if the cell(i,j) is null and cell(j,i) is not use
              cell(j,i)<br>
              3. otherwise report an error<br>
              <br>
            </blockquote>
            <div><br>
            </div>
            <div>
              <div>If you always have pairs A <-> B then you won't
                have a diagonal set.</div>
            </div>
            <div style="">In case there is no way in one direction
              (maybe even in both directions), then this could be -1 for
              example?</div>
            <div style="">Then it would be same as negative cost for
              Dijkstra or Astar and it won't be taken into account.</div>
            <div><br>
            </div>
            <div style="">Daniel</div>
            <div style=""><br>
            </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Thoughts?<br>
              <br>
              -Steve<br>
              <br>
              <br>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                <div class="im">
                  ... which would return the matrix in an optimized
                  order.<br>
                  I think it would be nice to be able to set origin and
                  destination point.<br>
                  But destination could be optional.<br>
                  <br>
                  Daniel<br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                      I'm not interested in computing the distance
                  matrix because I will<br>
                      not be able to do it "right" for any given use
                  case and it limits<br>
                      how people can use the function.<br>
                  <br>
                      Thoughts?<br>
                  <br>
                      -Steve<br>
                </div>
                    _________________________________________________<br>
                    pgrouting-dev mailing list<br>
                    <a moz-do-not-send="true"
                  href="mailto:pgrouting-dev@lists.osgeo.org"
                  target="_blank">pgrouting-dev@lists.osgeo.org</a>
                <mailto:<a moz-do-not-send="true"
                  href="mailto:pgrouting-dev@lists.osgeo.org"
                  target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
                    <a moz-do-not-send="true"
                  href="http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev"
                  target="_blank">http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev</a>
                <div class="im"><br>
                      <<a moz-do-not-send="true"
                    href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev"
                    target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a>><br>
                  <br>
                  <br>
                  <br>
                  <br>
                  --<br>
                  Georepublic UG & Georepublic Japan<br>
                </div>
                eMail: <a moz-do-not-send="true"
                  href="mailto:daniel.kastl@georepublic.de"
                  target="_blank">daniel.kastl@georepublic.de</a>
                <mailto:<a moz-do-not-send="true"
                  href="mailto:daniel.kastl@georepublic.de"
                  target="_blank">daniel.kastl@georepublic.de</a>><br>
                Web: <a moz-do-not-send="true"
                  href="http://georepublic.de" target="_blank">http://georepublic.de</a>
                <<a moz-do-not-send="true"
                  href="http://georepublic.de/" target="_blank">http://georepublic.de/</a>>
                <div class="im"><br>
                  <br>
                  <br>
                  _______________________________________________<br>
                  pgrouting-dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:pgrouting-dev@lists.osgeo.org"
                    target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev"
                    target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
                  <br>
                </div>
              </blockquote>
              <div class="">
                <div class="h5">
                  <br>
                  _______________________________________________<br>
                  pgrouting-dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:pgrouting-dev@lists.osgeo.org"
                    target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev"
                    target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <span
style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic
            UG & Georepublic Japan<br>
            eMail: <a moz-do-not-send="true"
              href="mailto:daniel.kastl@georepublic.de"
              style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>
            Web: <a moz-do-not-send="true" href="http://georepublic.de/"
              style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
pgrouting-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pgrouting-dev@lists.osgeo.org">pgrouting-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>